Jump to content
  • Advertisement
Sign in to follow this  
acid2

Pure Devices and getting matrices

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

Why can we not use getxyz with a pure device? To me it makes it seem that using a pure device is stupid, because it stops people making a scene graph... To do a scene graph you'd need to do SceneGraph.WorldMatrix.Push(Device.Transforms.World) - or handle matrices yourself but that seems kind of dumb. Any advice? Im tempted to just not use a pure device, but I assume I would be sacrificing a LOT then. Thanks, - aCiD2

Share this post


Link to post
Share on other sites
Advertisement
The whole point of a Pure device is so you CAN'T use the Get*( ) calls [smile].

The reasoning behind this is that it minimizes the work that the Direct3D layer has to do - and effectively puts the bias more towards the driver, the net result (in theory) is that it can operate more freely and attempt to get a bit more performance.

Quote:
To do a scene graph you'd need to do SceneGraph.WorldMatrix.Push(Device.Transforms.World) - or handle matrices yourself but that seems kind of dumb.

Nothing dumb about it really... It does rely on you doing a bit more work, but then again - you know what your application-space is, and have knowledge of how to implement it efficiently.

Also, you managing a few matrix variables means that your application is only keeping track of the information that is important to you - none of the other Get*( ) calls for example.

Quote:
Im tempted to just not use a pure device, but I assume I would be sacrificing a LOT then.

I don't think you'll be losing a huge amount by dropping back to a standard hardware device. But, what you're saying here sounds more like picking the easy option (fair enough really) - putting a bit of work in and you can still use a PD.

hth
Jack

Share this post


Link to post
Share on other sites
Nah, dropping the pure device would be the easy option, and I don't like the easy options ;) Plus, I've got performence available to me - why drop it? I hadn't seen that matrix stack that IFooBar mentioned but I will look into it.

Thanks for your replies lads, that's cleared a lot up for me :)

Share this post


Link to post
Share on other sites
I've set the graph up to use the MatrixStack, but if I do the following i don't get a sphere rendered at 0, 5, 5 - am I doing something wrong?


// I actually use MultiplyMatrix with a matrix, but I just put it like this to make it simple
myMatrixStack.Push();
myMatrixStack.MultiplyMatrix(Matrix.Translate(0, 0, 5));
myMatrixStack.Push();
myMatrixStack.MultiplyMatrix(Matrix.Translate(0, 5, 0));

Device.Transform.World = myMatrixStack.Top;

myMatrixStack.Pop();
myMatrixStack.Pop();

The above results in a sphere or whatever rendering at 0, 5, 0 - not 0, 5, 5 as expected. Even doing the code underneith doesn't work :(
myMatrixStack.MultiplyMatrix(myMatrixStack.Top * Matrix.Translate(0, 0, 5));


I thought that the MatrixStack handled this for the user? Any ideas?

[Edited by - acid2 on March 2, 2005 2:23:55 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!