# Make a laser beam effect with Ogre and a BillboardChain

http://www.lpi.usra.edu/lunar/missions/apollo/apollo_15/images/laser_beam_lg.gif

I want to be able to such an effect, but I don't really know how the BillboardChain class works or how I can use it, examples for this class seems to be rare.

I have created an impressive laser by using particles, here is an example of what a laser particle script would look like:

particle_system Space/Laser
{
material        Examples/Flare
particle_width  3
particle_height 3
cull_each       false
quota           1000000
billboard_type  point
local_space true

// Area emitter
emitter Point
{
angle           0
emission_rate   500
time_to_live_min 1000
time_to_live_max 1000
direction       0 0 -1
velocity       1000
colour 1.0 0.27 0.0
}
}


Simply create a particle system using this script, attach to its own node, and toggle visibility on the node to make the laser appear/disappear.

This will create a nice Orange laser beam where you can change the size by editing the particle_width and particle_height attributes. To change the length of the laser edit the time_to_live_min and time_to_live_max attributes but make sure they are the same value.

The material Examples/Flare comes with the OgreSDK by default so you don't have to worry about it (It just uses a nice flare image that the particle script will re-color and use).

Be sure to save it as a .particle file

The closest thing I have seen to this effect is this

There is also this thread that asks the exact same question. It only has 3 replies, but probably worth watching (unless of course you asked this question :P)

• Why the downvote? Feb 21 '11 at 15:33
BillboardChain bbchain;
bbchain.addChainElement(BillboardChain::Element(Vector3(0,0,0), 10, 0, ColourValue(1, 0, 0)));


The main reason it was not working for me is because I did not set a high enough width.

• I can't tell if this is supposed to be an "I have found the answer to my own question" post or a "clarification of my original question" post -- if the former you should mark it as the answer (I think you can accept your own answers) and if the latter it should be a comment or edit to the original question.
– user1430
Mar 23 '11 at 15:46
• yes, but I had to wait for marking it as an answer, aqll done now ! Mar 23 '11 at 21:28