Hello,
I have a small problem. I have a small triangle - see attachments "coordinatesystem.bmp":
v[0].pose = SlimDX::Vector3( -0.5f, +0.0f, 0.0f );
v[0].color = 0x000fff; //
v[1].pose = SlimDX::Vector3( +2.5f, +0.0f, 0.0f );
v[1].color = 0x000fff; //
v[2].pose = SlimDX::Vector3( +0.0f, +1.5f, 0.0f );
v[2].color = 0x000fff; //
Unfortunately, this triangle is depicted reverse. +X axis is on the left side, -X axis in on the righ side, +Y is Top, -Y is bottom.
+Z heading to me, out of screen and -Z heading to screen. see the attachments.
I am using only these commands:
sl_device->SetTransform( SlimDX::Direct3D9::TransformState::View,
SlimDX::Matrix::LookAtLH( SlimDX::Vector3( 0.0f, 0.0f, 15.0f ), //
SlimDX::Vector3( 0.0f, 0.0f, 1.0f ),
SlimDX::Vector3( 0.0f, +1.0f, 0.0f ) ) );
sl_device->SetTransform( SlimDX::Direct3D9::TransformState::Projection,
SlimDX::Matrix::PerspectiveFovLH( (float)Math::PI / 2, 1.76795f, 0.1f, 100.0f) );
If I use these commands:
sl_device->SetTransform( SlimDX::Direct3D9::TransformState::View,
SlimDX::Matrix::LookAtLH( SlimDX::Vector3( 0.0f, 0.0f, 15.0f ), //
SlimDX::Vector3( 0.0f, 0.0f, 1.0f ),
SlimDX::Vector3( 0.0f, +1.0f, 0.0f ) ) );
sl_device->SetTransform( SlimDX::Direct3D9::TransformState::World,
SlimDX::Matrix::Translation( 0.0f, 0.0f, 0.0f ) *
SlimDX::Matrix::RotationY( 0.785f ) *
SlimDX::Matrix::RotationX( 0.785f ) *
SlimDX::Matrix::RotationZ( 0.785f )
);
sl_device->SetTransform( SlimDX::Direct3D9::TransformState::Projection,
SlimDX::Matrix::PerspectiveFovLH( (float)Math::PI / 2, 1.76795f, 0.1f, 100.0f) );
Situation is identical see attachments "coordinatesystem2.bmp"
I supposed that SlimDX uses left-hand coordinate system. It is: +X is on the right side, -X is on the left side,+Y is top, -Y bottom,
+Z headings to my LCD monitor and -Z heading to me.
What is wrong ? I have somewhat reversed coordinate system.