Jump to content
  • Advertisement
Sign in to follow this  
Isometric God

[SlimDX] Device.SetTransform is ignored

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

Hi, this question might be really stupid, but I can't see whats wrong: I modified the MiniTri sample that ships with SlimDX:
...
vertices.Unlock();

// NEW
device.SetTransform(TransformState.World, Matrix.Scaling(2.0f, 2.0f, 2.0f));


MessagePump.Run(form, () =>
...
I expect the triangle to be bigger, but it just isn't. I also tried several modifications on the SetTransform() parameters, but the scene doesn't change at all. Thanks for your help

Share this post


Link to post
Share on other sites
Advertisement
If I remember right the sample uses PositionRhw as the position part of it's vertex format.

This means the vertices are not transformed by the pipeline, even if you've set transforms on the device.

You need to switch to just regular Positions (Vector3) and setup a view and projection matrix to get your world transform to function... and probably adjust the vertex positions accordingly.

Share this post


Link to post
Share on other sites
Quote:

If I remember right the sample uses PositionRhw as the position part of it's vertex format.

Yup. PositionRhw indicates pretransformed vertices that will never not have the vertex shader applied to them (not even the fixed function emulation shader). They are little more than an academic curiosity these days, useful only for things like samples, since you can achieve must better controlled results without them.

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!