• Advertisement

Archived

This topic is now archived and is closed to further replies.

no triangle in immediate mode

This topic is 6712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


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

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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!

Share this post


Link to post
Share on other sites
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/

Share this post


Link to post
Share on other sites

  • Advertisement