View Full Version : billboarding problem
10-03-2001, 10:43 AM
In my Project I´m doing a "camera" not by glutLookAt() or similar, but just by two calls of glRotatef, one fpr the x, the other for the y axis.
Well, how can I now achieve that all polygons(I want to draw a sun..and later Particles) face my pseudo-camera???
I tried just by Rotating negative values on both axis, but doesn´t work. :-(
10-03-2001, 03:28 PM
Blegh, I just got done working on that! I'll get the exact code to you as soon as I can get on my computer again!
10-03-2001, 08:32 PM
Just call glRotatef along x and y with inverse angles so that it is not affected by the rotation and is always facing you
now billboard will always be facing you http://www.opengl.org/discussion_boards/ubb/smile.gif
Sorry, but the rotation "cheat" it's not the cleanest way to do billboarding, expecially if your matrix stack is growing faster. Think about getting back from a matrix of a robot harm or something similar.
I personally use 2 ways :
1)Real billboarding, get the actual matrix and use it to calculate the position of the billboarded poly.
2)set an ortho view and use 2D coords to draw shapes. (I use this way for lens flares)
http://nate.scuzzy.net for more samples on billboarding.
10-04-2001, 04:34 AM
Yeah, your right... the best way is always the right way. Mine was just a dirty hack for this particular situation http://www.opengl.org/discussion_boards/ubb/smile.gif
10-04-2001, 04:57 AM
Ah Thank you, works with the code from http://nate.scuzzy.net very well!! Thanx!
But the cheat doesn´t work... :-)
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.