Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / I want to make distortable meshes.

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Jan 2011 01:57
I want to make a game like in the link....

http://megaswf.com/simple_serve/102223/

But I don't know how to build the meshes from scratch, and distort them.

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 28th Jan 2011 02:30
Well it seems as if this is just 2d, i would make an array with the coordinates, these coordinates connected by lines. I'd modify a part of the array to change things around. Now if you are talking 3d, i know you can use some modify vertex command, though ive never used it myself. You can make the meshes used in 3d objects by using a 3d modeler, i use wings 3d, it's easy, free, intuitive, and efficient. Plus, it's open source making it likely to be higher quality than lots of modelers out there

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Jan 2011 09:29 Edited at: 28th Jan 2011 09:31
That should be quite straightforward to do with memblocks - as they can be made from a center point, like create polygons from the center point to a random radius, while increasing the angle. Those are often referred to as convex shapes, because they don't overlap, and they tend to be really good for collision detection. I would make the first polygon between the centre, and first and second points, then connect the previous, centre, and point each time. I could write a little mesh demo if it would help.

For example, if you used just line collision, you could check the mesh centre point, to any point in 2D space, count how many lines intersect between those points. Then if that number is odd, the point is outside the shape, if it's even, then that point is inside the shape - very handy. It would probably work nicely with Box2D.

Health, Ammo, and bacon and eggs!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Jan 2011 11:50 Edited at: 28th Jan 2011 12:04
Thanks guys! Yeah Van B, can you show me a demo? Can I colour the convex shapes? And the road is random as well, so I suppose that the road is similar convex shapes?

Had a look at the Vertex commands last night, and they seem OK too. maybe a 3D version is possible? I had this idea of adding some sort of metallic effect as well, sphere mapping the polygons. Is that possible? But I might not go 3D if that is too hard.

I was also thinking of making some wheels in a modelling package, and just scaling them so that they look better than just circles.

Not too bothered what I end up with, but the wheels certainly need something doing with them.

The gravity is very good in that program, taking weights from every design.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Jan 2011 13:30
With 3D, you could start with a low poly sphere, setting the row and column setting low when creating it, then push out each vertex to a random offset would create the shape. Then with Newton physics, make it into a convex hull for good collision and mass calculation too. Maybe attach vehicle wheels to it and see how it rolls down a 3D modelled course, or terrain. I think that is actually easier than doing it in 3D. Could even let the user mould the sphere, as each vertex would be pushed out radially, no chance of them overlapping and getting messy.

I will see what I can come up with tonight.

Health, Ammo, and bacon and eggs!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Jan 2011 13:53
Yeah, I was just looking at the Newton Physics Wrapper. I'm not very good at maths though. Be nice to have a few camera angles, so the 3D sounds much better.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Feb 2011 14:25 Edited at: 3rd Feb 2011 14:25
I still haven't made my mind up. I have however made a model of a motorbike which I want to deform. I have two choices...

Buy Blitzwerk Terrain, and make a complete 3D landscape, but then I have the problem of figuring out the physics using Newton. But I end up with a much better 3D game engine.

Or buy Box 2D and just make a 2D version of the game, but much easier with the Mini Demo doing everything that I want.

My problems are not understanding Newton very well. So maybe I should ask some questions about Newton.

1/ In Newton, if I rotate the bike wheels does that automatically create forward motion through the motorbike?

2/ In Newton, how difficult is it to pass the collision with the landscape through the various parts of the motorbike. Starting with the wheels I have suspension, then various body frame parts.

3/ In Newton can I deform the bike, and instantly get deformed collision?

Same with Box 2D. Can I deform the bike, and instantly get new collision.

It does look like Box 2D has the rotating wheel moves bike. So that looks easy. I just wanted a nice 3D landscape really.

If somebody could show a deforming bike on a 3D landscape, and wheels turning to move the bike along I would decide on Blitzwerk terrain.

Login to post a reply

Server time is: 2026-07-17 18:53:28
Your offset time is: 2026-07-17 18:53:28