Jump to content

  • Log In with Google      Sign In   
  • Create Account


no triangle in immediate mode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 LeeIsMe   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 September 1999 - 05:20 AM

The following code gives no errors, but doesn't show anything on the screen either.

ddevice->BeginScene();

D3DVECTOR p1( 0.0f, 100.0f, 0.0f );
D3DVECTOR p2( 50.0f,150.0f, 0.0f );
D3DVECTOR p3(20.0f,40.0f, 0.0f );

D3DCOLOR b = 0; //black
Vertices[0] = D3DTLVERTEX( p1, 100, b,b,0, 0 );
Vertices[1] = D3DTLVERTEX( p2, 100, b,b,0, 0 );
Vertices[2] = D3DTLVERTEX( p3, 100, b,b,0, 0 );

ddevice->DrawPrimitive(D3DPT_TRIANGLELIST,D3DVT_TLVERTEX,(LPVOID)&Vertices,3,D3DDP_DONOTCLIP);

ddevice->EndScene();

------------------
http://mazurek.dhs.org/3d/


Sponsor:

#2 prauppl   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 September 1999 - 02:49 PM


Well,

See, you are setting the color component to 0.0f, which is pure black. (b = 0). I think thats where you're going wrong...
Everything else seems ok for me...

- prauppl


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 04 September 1999 - 04:45 PM

I'm not sure, but I remember when I was messing around with TL_VERTEX that the Z value was _real_ sensitive. Try putting it to 0.5f.

If that doesn't help, give me an email (snowman_83@yahoo.com) and I'll look up how I did it.

-Snowman


#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 04 September 1999 - 07:16 PM

I had a similar problem when converting some of my code from DirectX 5.0 to 6.1. If you are not using 6.1 or are not using the new IDirect3DDevice3 interface, then this probably won't help, but if you are, you simply need to change the following in your call to DrawPrimitive

D3DVT_TLVERTEX
< to >
D3DFVF_TLVERTEX

This is because the new DrawPrimitive makes use of the flexible vertex formats. D3DFVF_TLVERTEX is for compatibility with older versions of DirectX. Hope this helps!


#5 LeeIsMe   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 September 1999 - 05:20 AM

I figured out it was not showing because of back face culling.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS