Jump to content
  • Advertisement
Sign in to follow this  
sgdimitris

Cartesian system in DirectX

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

Hello, my name is Dimitris and I have the following matter for my project:
I want to show 3D points in a cartesian system. I can show the points but not show the x,y,z axes.
Is any way to do that? Or is there any sample somewhere which can help me?
I used the “Sample 04: 3D Spaces” example from the Tutorials in the Sample Browser of the DirectX SDK but I cannot simultaneously show axes and points.
I would appreciate if someone could help me, cause I know that for most directx users this is easy but not for me

Share this post


Link to post
Share on other sites
Advertisement
use line to draw x, y and axes BTW which version of Direct3D API are you using? Set it's primitive topology to D3D11_PRIMITIVE_TOPOLOGY_LINELIST (D3D 11)

Share this post


Link to post
Share on other sites
The easiest thing would probably be to split it into two draw calls.
set the primitive topology to pointlist before you draw your points, then to linelist before you draw your axes.

your vertex buffer for the axes might look like this:


XMFLOAT3 vertices[] = { XMFLOAT3(0, 0, 0), XMFLOAT3(10, 0, 0),
XMFLOAT3(0, 0, 0), XMFLOAT3(0, 10, 0),
XMFLOAT3(0, 0, 0), XMFLOAT3(0, 0, 10), };

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!