Hello, I have a petty problem. I have two triangles - see "triangles perspective.bmp"
Axis +X is marked RED cross, +Y is marked GREEN cross, axis +Z is marked BLUE cross.
Both are ClockWise and CULL mode is off.
Hello, I have a petty problem. I have two triangles - see "triangles perspective.bmp"
Axis +X is marked RED cross, +Y is marked GREEN cross, axis +Z is marked BLUE cross.
Both are ClockWise and CULL mode is off.
It sounds like you don't have depth testing enabled. You'll need a depth buffer and the proper depth-stencil state set in order to get the correct sorting of those triangles.
Great. How can I set depth buffer ?
If I set
_presentParameters->EnableAutoDepthStencil = true;
I see nothing ... black screen
The Blue triangle is depicted in front ot the green.
That's correct. Your camera is at -15, the Blue triangle is at -10.5, the Green triangle is at +10.5.
EDIT: I was incorrect. I had the colors reversed. See response below.
_device->SetRenderState( SlimDX::Direct3D9::RenderState::ZEnable, true );
leads to D3DERR_INVALIDCALL: Invalid call (-2005530516)
at
_device->Clear( SlimDX::Direct3D9::ClearFlags::Target | ClearFlags::ZBuffer, SlimDX::Color4( SlimDX::Color3( 0.0f, 0.0f, 0.0f )) , 1.0f, 0 );
no no BLUE triangle is at +10.5f, GREEN at -10.5f,
it means, that GREEN is before BLUE, I should have seen GREEN first, that BLUE
terrible
COLOR 0xff00ff00;
means:
FF is alpha, 00 is RED, FF is GREEN, 00 is BLUE = GREEN
FF is aplha, 00 is RED, FF is GREEN, F0 is BLUE = BLUE
BLUE triangle is far
nice,
please, can someone take a look at this simple severaal-lines code.
https://onedrive.live.com/redir?resid=6C2D62DDB1948596%21287
I really do not know why blue triangle is before green. It is not normal....maybe I am dumbass