primitive question ><

This is a discussion on primitive question >< within the Game Programming forums, part of the General Programming Boards category; hey having trouble, desgned a vertex for a squashed rectangle shape thing but being a newb to 3d i always ...

  1. #1
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80

    primitive question ><

    hey having trouble, desgned a vertex for a squashed rectangle shape thing but being a newb to 3d i always stump my toe on stupid problems, the code below shows two sets of two triangle primitives exactly the same coding except the middle two coordinates have been switched, the initial non working primitives are the ones i created, and the second lot is the ones i re ordered and got to work. but the thing i dont get is when drawing the triangle i dont get why the second two points require a specific order for them to function..
    BTW using trianglestrip draw mode

    Code:
    //first 2 NON working primitives
    {303,85,32,1,D3DCOLOR_ARGB(0,255,255,255),},
    {182,144,32,1,D3DCOLOR_ARGB(0,255,255,255),}, // these rows
    {455,219,32,1,D3DCOLOR_ARGB(0,255,255,255),}, // as drawn
    {318,307,32,1,D3DCOLOR_ARGB(0,255,255,255),},
    
    //second 2 working primitives
    {303,85,32,1,D3DCOLOR_ARGB(0,255,255,255),},
    {455,219,32,1,D3DCOLOR_ARGB(0,255,255,255),},//these rows
    {182,144,32,1,D3DCOLOR_ARGB(0,255,255,255),},//switched
    {318,307,32,1,D3DCOLOR_ARGB(0,255,255,255),},
    any help is much appreciated, thanx
    You can stop change as easily as u can drink the sea with a fork

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,597
    For 2D only:
    Code:
    Device->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);
    Device->SetRenderState(D3DRS_ZENABLE,false);

  3. #3
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80
    the code works just dandy, zenable i didnt need however. as i said im a beginner at this 3d3 malarky, could you explain cull modes abit please, ive visited the online msdn but thrs no real help thr except for a two or three word answer and the book im learning from likes you to just "ACCEPT CODE" without giving an explanation of the parameters being passed,

    thanx again
    You can stop change as easily as u can drink the sea with a fork

  4. #4
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80
    -----sry 2 b a pest
    scrap my post found some good info on render states,
    You can stop change as easily as u can drink the sea with a fork

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,597
    -----sry 2 b a pest
    You are not being one. It's my pleasure to help - I only knew the solution because I ran into the same exact thing.

  6. #6
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by MicroFiend
    the code works just dandy, zenable i didnt need however. as i said im a beginner at this 3d3 malarky, could you explain cull modes abit please, ive visited the online msdn but thrs no real help thr except for a two or three word answer and the book im learning from likes you to just "ACCEPT CODE" without giving an explanation of the parameters being passed,
    As far as I can make out from various sites and books, culling is basically a technique to hide polygons that the viewer can't see. Basically it determines which polygons to hide based on which direction the vertices are drawn - either clockwise or counter-clockwise. I have no idea which one is front and which one is back though, so check what culling mode you were using and which one was showing up and there's the answer.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 06:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 01:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21