Archived

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

kudi

billboarding

Recommended Posts

kudi    244
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
Gazza    122
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
baskuenen    124
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