[SlimDX] Device.SetTransform is ignored

Started by
2 comments, last by jpetrie 14 years ago
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
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.
Ooooohhh, right, thanks a lot!
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.

This topic is closed to new replies.

Advertisement