Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kudi

billboarding

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

Hello, I would like to render my scene with billboards. Here you can see some code for the view-initialisation:
loc=g_PI/180.0f*225.0f; view_loc.x=float(cos(loc)); view_loc.y=53.0f; view_loc.z=float(sin(loc)); D3DUtil_SetViewMatrix(view_matrix, view_loc, D3DVECTOR(float(cos(loc+g_PI/180)),52.5f,float(sin(loc+g_PI/180))) D3DVECTOR(0.0f,1.0f,0.0f)); lpD3DDevice->SetTransform(D3DTRANSFORMSTATE_VIEW,&view_matrix);
Now, how can I set the world-matrix to make my billboards?

Share this post


Link to post
Share on other sites
Advertisement
There is an in depth tutorial on billboarding at

www.mr-gamemaker.com

It shows how to manipulate the View and World matrices to make billboards or any sort of LookAT matrix as well as how to make a restrictive LookAt funtion like a Gun Turret on a tank for example.

Hope its of some use to you

Gaz

Share this post


Link to post
Share on other sites
Billboarding is simply resetting the rotation part of your matrix.
- Save the current position.
- LoadIdentity()
- Translate using the saved position
- tada

Share this post


Link to post
Share on other sites

  • 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!