adding image to verlet physics

Started by
4 comments, last by phi 17 years, 10 months ago
Hi Ive managed to get my verlet physics working. However, I'm not sure how to attach images to the particles and constraints. For example, a square is made up of four particles and 6 constraints. I can draw the particles and constraints, but how do I use an image instead? At the moment, I can't get the image to rotate with the "mesh" because techincally it's not connected in any form to the mesh. Any ideas? Thanks
Advertisement
Well, assuming you're using direct3d or opengl, the easiest way would be to simply draw a textured quad using the particles to define the vertices of the primitive.
If there were to be a lot of quads on screen at once, would there be a huge slowdown? It is, however, a 2D game so only one side will be textured, but I'm not sure how fast it is.
Thanks for the help.
Quote:Original post by phi
If there were to be a lot of quads on screen at once, would there be a huge slowdown? It is, however, a 2D game so only one side will be textured, but I'm not sure how fast it is.
Thanks for the help.


Both Direct3D and OpenGL use hardware acceleration, which makes rendering uber-fast; if a modern 3D game can render complex scenery consisting of thousands of polygons, you can certainly afford to render as many quads as you want. Even older computers shouldn't have any problems with reasonably large amounts of quads. That said, its still a good idea to implement some kind of culling; don't draw quads that aren't on the screen.
Quote:Original post by phi
Hi
Ive managed to get my verlet physics working. However, I'm not sure how to attach images to the particles and constraints. For example, a square is made up of four particles and 6 constraints. I can draw the particles and constraints, but how do I use an image instead? At the moment, I can't get the image to rotate with the "mesh" because techincally it's not connected in any form to the mesh. Any ideas?
Thanks


I think you mean't 'Jakobsen' physics. Verlet is just an integration method, it is not limited to just that one method involving the particles and constraints, etc.
Indeed I meant Jakobsens physics. However, I have run into a problem. I am using blitzmax but I cannot seem to create quads. Does anyone know how to create quads in bmax?
Thanks

This topic is closed to new replies.

Advertisement