Hi, I'm trying to do a 3D tile engine in DirectX 8. My tiles are loaded into VBs (one for each) but I don't know how to draw the same VB at different positions. I don't want to modify the VB data by the way. Thanks for help!
Printable View
Hi, I'm trying to do a 3D tile engine in DirectX 8. My tiles are loaded into VBs (one for each) but I don't know how to draw the same VB at different positions. I don't want to modify the VB data by the way. Thanks for help!
You should search for matrix manipulations, check out dx4vb.da.ru there you will find a little bit about matrices. But I don't know how good they work in 2D mode
Thanks, I found out how it works. I didn't notice that I can translate the WorldMatrix to change to position of the next buffer.
Good for you! A lot of people actually dont understand that =). One thing to think about though, is how you have your buffers set up. Do you have one tile (2 triangles) per buffer? This is extremely inefficient. The target number of vertices per call to DrawPrimitive is ~200. Otherwise, you will get a speed penalty. Also, changing Vertex buffers can be an expensive operation, as well =). Many people will suggest that you construct your buffers so that you actually store a 16x16 tile chunk in one buffer, to be drawn at one time.
Z.
Yes I found out about that, thanks again Zaei and Lupin.
This sounds like good stuff Ill copy and paste this for later use :)
Cheers guys