is there any way to rotate a billboard?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
luvcraft
Posts: 23
Joined: Sun Apr 25, 2004 1:00 am
Location: Albuquerque, NM

is there any way to rotate a billboard?

Post by luvcraft »

The subject pretty much says it all.
michael520
Posts: 230
Joined: Mon Oct 10, 2005 2:24 am

Post by michael520 »

just don't use billboard then! :roll:
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

I just spent 3 weeks on this topic. i wanted to rotate a billboard along its z axis, yet still have it face the user. so a user would see a rectangle, then he would see a diamond after rotation.

I had zero luck.But there has to be a way to do it! I duplicated the Irrlicht billboard class and mucked around with matrix transforms, but no luck. I have a example from the freespace2 open sourcecode, but was never able to reproduce it.

:(
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

wikipedia abridgement:
In 3D computer graphics, to billboard is to rotate an object so that it faces the
viewer. A billboarded object is sometimes called an impostor.
use a userdefined scenenode instead of a billboard. take a look at the
"CBillboardSceneNode.cpp" function "render", then u can see that the node
always rotate to the viewer...

:)
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

I have the code for a "RotatingBillboard". I think i saw the link in this forums, but cant remeber who is the author or where to find it again (couldnt get it by searching). I will post the code tomorrow (have no the code here).

The behaviour in the demo is the image of the sprite md2 (probably you saw it in the irr tutorials) and it changes depending on the angle the camera points the billboard.

I also think this is not a behaviour for a billboard, but its probably what youre looking for, isnt it?


@dhenton9000
sry i didnt see your threads (if there were any). Its easy to implement; just:
calculate the angle on the Y axis from the camera ray respect the Z axis. if angle is between A1 and A2, billboard shows Sprite1, if angle is beetween A2 and A3, billboard shows Sprite2... and so on.

Dont know if this is the implementation that i have, but think this way should work too.

As i said, wait for the code, will post tomorrow.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Dont know if this is the kind of rotation you wanted, but take a look at:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=12251
finger007

Post by finger007 »

as i get it, luvcraft and dhenton9000 are meaning something else.

like this: standard-billboard-behaviour + rotation along an additional axis.
as an example: the rocking leaf-planes of idvinc's "SpeedTree"s (have a look at http://www.speedtree.com/html/speedtreert.htm )

your approach is like faking a 3d-object by using a billboard as e.g. RPC-technique (planes with animated texture depending on time-frame and/or camera-angle).
i just downloaded and tried your example. looks good. definitely have to look at the source.

luvcraft and dhenton9000, if you make progress in your approach, please let us know. i tried this myself (not in irrlicht though) and also failed... :(

cheers
Post Reply