Sign in to follow this  
martinperry

DX Matrix converting

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

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