Results 1 to 6 of 6

Thread: Drawing the same VertexBuffer at different coordinates.

  1. #1

    Thread Starter
    Junior Member NGE's Avatar
    Join Date
    Feb 2001
    Location
    Neo-Tokyo 3
    Posts
    26

    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!

  2. #2
    Junior Member
    Join Date
    Aug 2002
    Posts
    16
    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

  3. #3

    Thread Starter
    Junior Member NGE's Avatar
    Join Date
    Feb 2001
    Location
    Neo-Tokyo 3
    Posts
    26
    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.

  4. #4
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  5. #5

    Thread Starter
    Junior Member NGE's Avatar
    Join Date
    Feb 2001
    Location
    Neo-Tokyo 3
    Posts
    26
    Yes I found out about that, thanks again Zaei and Lupin.

  6. #6
    Lively Member
    Join Date
    Jul 2002
    Posts
    118
    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
  •  



Click Here to Expand Forum to Full Width