Thread: Best way to draw several quads?

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001

    Best way to draw several quads?

    In my engine I need to enhance my terrain a bit. I want to add grass and trees here and there but every method I've come up with requires several calls to DrawIndexedPrimitive.

    Basically my plan is to have a triangle list of quads. Then when one quad has been drawn I translate the next one in the list by _positions[i].x,_positions[i].y,_positions[i].z. Of course I'm getting the height from my terrain so the grass is sitting on the terrain...but thats about it.

    I know DX does not like a lot of calls to DrawPrimitive. How can I do this with one call? Problem is each quad needs to be translated/rotated in the world.

    I think I've gotten past the Direct3D level that most web sites cater to as information on the stuff I want to do does not seem readily available.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    In OpenGL you can pre-compile a call list of gl commands. Then you can just translate and rotate around calling the pre-compiled list. Maybe DX has some type of equivalent functionality you can use?

  3. #3
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Sure, tempt him with OpenGL .
    Do not make direct eye contact with me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which is the better way to draw?
    By g4j31a5 in forum Game Programming
    Replies: 16
    Last Post: 01-22-2007, 11:56 PM
  2. draw function HELP!!!
    By sunoflight77 in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:28 PM
  3. ray casting
    By lambs4 in forum Game Programming
    Replies: 62
    Last Post: 01-09-2003, 06:57 PM
  4. Draw Shapes.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-19-2002, 09:22 AM
  5. Transparent Draw Question
    By GodLike in forum Windows Programming
    Replies: 5
    Last Post: 05-07-2002, 06:56 AM