Jump to content
  • Advertisement
Sign in to follow this  
MariaW2006

Wireframe with Direct 3D for testing purposes

This topic is 4650 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

I'm working on developing a simple 3D game engine just to learn more about things. I'm using Direct 3D and C. I'm not really a newbie i know how to program in C (a and a whole bunch of other languages) from Computer Science at university. I can do basic stuff with open GL, but i'm pretty new to Direct X especially Direct3D. What i want to know is is it possible to have it draw my verticies as a wireframe for testing purposes? I am loading my vertices into a position only type vertex buffer and I tried using DrawPrimitives to draw them, but this doesn't work. I assume this is because I haven't created any lights or told the renderer what colour to use, but i'm not sure how to do this with direct 3D. With open gl you can set the drawing color using GLColor calls. Is there an equivelent for Direct 3D? Maybe i should just re-write for open gl.

Share this post


Link to post
Share on other sites
Advertisement
You can enable wireframe rendering with:

gDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);


Quote:
With open gl you can set the drawing color using GLColor calls. Is there an equivelent for Direct 3D?


You'll need to allow for diffuse colour in your FVF definition, by ORing in D3DFVF_DIFFUSE. Eg.

const DWORD MyFVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;


Quote:
Maybe i should just re-write for open gl.


If you do feel more comfortable with OpenGL, and have no reason to use D3D, then maybe you should switch back. On the flip side, D3D is worth learning as well, if you give it the time. Things definitely function a lot differently, but your dedication may pay off in the end. :)

Good luck, irregardless of your choice.

Share this post


Link to post
Share on other sites
Excellent i can now see my standard 1 metre cube cells so now i can use this code to write an editor and do my map.

it also helped to call EndScene before Present instead of the other way around.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!