Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / problem with facing bitmaps Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
zwito

April 07, 2005, 01:46 AM

Hi all!

I have a small problem. I'd like to get burning fire on my scene in fpp game and I dysplay this by creating rectangle and textured this. ok but if i move, the rectangle is ofcourse still where it was put it is no "facing" me. I figured out that to make a fire or other image facing me i should do following things:

- have a bitmap :)
- calculate my velocity vector(camera velocity vector)
- calculate the angel between this vector and axe "OX" ,"OY" and "OZ"
- rotate verticles of my rectangle through this angles
- transform to good x,y,z and display?

it is good ??? or is there any other easier metod??

 
Reedbeta

April 07, 2005, 02:22 AM

Yes, that is basically what you have to do (although there are optimizations so that you don't have to work directly with the angles, hence no trigonometry). Google for "billboarding".

 
juhnu

April 07, 2005, 08:17 AM

you can use your players orientation(camera matrix aka inverted view matrix) directly to get the correct axis. So store the just the position of the bitmap and calculate the correct edge positions using the axis vectors you got from the camera matrix.

juhani

 
This thread contains 3 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.