|
-
Sep 1st, 2002, 04:48 AM
#1
Thread Starter
Junior Member
Drawing the same VertexBuffer at different coordinates.
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!
-
Sep 1st, 2002, 06:44 AM
#2
Junior Member
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
-
Sep 1st, 2002, 07:06 AM
#3
Thread Starter
Junior Member
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.
-
Sep 1st, 2002, 10:24 AM
#4
Frenzied Member
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.
-
Sep 1st, 2002, 10:36 AM
#5
Thread Starter
Junior Member
Yes I found out about that, thanks again Zaei and Lupin.
-
Sep 1st, 2002, 12:43 PM
#6
Lively Member
This sounds like good stuff Ill copy and paste this for later use 
Cheers guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|