Skip to main content
GameDev.net gamedev.net
🔒 Locked

Cartesian system in DirectX

Started by sgdimitris Mar 2, 2012 at 1:35 PM 1 replies 1.1k views
Original Post
sgdimitris
sgdimitris
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
Asesh
Asesh
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)
melak47
melak47
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), };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.