Sign in to follow this  

Stuck with how to make tiny.x stay in cam view

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

<p>I have a terrain and i  have tiny.x , what i would like todo is make tiny.x stay in view of the camera no matter if i rotate it with the mouse , this is the matrix so far

//these members are in the camera.h class
// Relative to world space.
D3DXVECTOR3 mPosW;
D3DXVECTOR3 mRightW;
D3DXVECTOR3 mUpW;
D3DXVECTOR3 mLookW;

fPos.x = gCamera->mPosW.x;
fPos.y = gCamera->mPosW.y - 0.05f;    
fPos.z = gCamera->mPosW.z + 0.1f;  

D3DXMatrixTranslation(&mWorldTrans,fPos.x,
                                 fPos.y,
            fPos.z);
HR(mFX->SetMatrix(mhWVP, &(mWorldScale*mWorldRotZ*mWorldTrans*gCamera->view()*gCamera->proj())));

Share this post


Link to post
Share on other sites

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