Sign in to follow this  

DX Matrix converting

This topic is 2491 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,

I am using my matrix class for transformations. Is got approach to do this ?
[code]
this->device->SetTransform(D3DTS_VIEW, reinterpret_cast<D3DMATRIX*> (&camera->GetViewMatrix()));
[/code]

Or its slow doing it every frame ?

Share this post


Link to post
Share on other sites
[quote name='martinperry' timestamp='1298113006' post='4776276']
Hi,

I am using my matrix class for transformations. Is got approach to do this ?
[code]
this->device->SetTransform(D3DTS_VIEW, reinterpret_cast<D3DMATRIX*> (&camera->GetViewMatrix()));
[/code]

Or its slow doing it every frame ?
[/quote]If you set the view matrix ONCE AND ONLY ONCE each frame then it is not slow. However, repeatedly rebuilding (I'm not sure whether your GetViewMatrix function caches already-made view matrices or rebuilds them each time you call it) and resetting the device transforms is not efficient when you do it unnecessarily multiple times per frame.

Share this post


Link to post
Share on other sites

This topic is 2491 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this