Sign in to follow this  
Anddos

what space todo picking in

Recommended Posts

if i am rendering like this and want to pick the object which is the gun , what space do i need to convert the ray to?

D3DXMatrixTranslation(&World,Pos.x,Pos.y,Pos.z);
D3DXMatrixScaling(&gunScale,100.0f,100.0f,100.0f);
HR(GunEffect->SetMatrix(mWorldProj, &(gunScale*World*gCamera->proj())));

Thanks if you can help

Share this post


Link to post
Share on other sites
You can transform a world ray by the inverse of scale*translation. Be sure to transform the result by scale*translation to get the results back into the world.

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