Question about Lasers

Started by
5 comments, last by sdoherty55 21 years, 11 months ago
I was wondering if I could get some advice on implementing an easy Laser. Currently, I am scaling a cylinder in the direction of the Laser. It seems to work for building the laser, but when I try to kill the laser I can''t just un-scale the cylinder because the Laser would be moving in the wrong direction. However, I am able un-scale the Laser while moving moving the beam in the oposite direction. This will work, but it seems like such a hack. Also I would be foreced to implement a more advanced form of colision detection than is really necessary for what I am doing. Is there beter/easy way to implemant a laser?
Advertisement
Why not use a billboard? 2 triangles aligned with the camera sure makes things faster for collision detection instead of using a whole cylinder!
Sorry, what is a bill board? Where are the triangles positioned within the laser? Is one triangle at the front and other at the back? Two triangles might remove the complexity around colision detection, but how can I make removing the laser look right?
MOE, I looked up BillBoard on google. It is just two triangle back to back forming a square. I will keep reading, but I am assuming that in order to create the laser you scale the two triangles in the direction of the laser? Still not sure how to remove the laser after I am done with it?
What do you meen by scaling a cylinder in the direction of the laser?

And what do you meen by un-scaling the cylinder?´

A verry simple laserbeam would be for example a 6-sided cylinder. You dont have to scale it just move it along the line of fire.

If you wanna a glowing laser then you probably would have to use a textured quad or several quads. For example you can build your laser from 3 quad planes placed like a cross. You then paint two texture one from where the laser is seen in the radial direction and one where the laser is seen in axial direction. Apply those two textures to the quads and the you have a laserbeam in 3D ( no billboard neded ).

Id say a billboard woldnt work for a laserbeam.
< There are no stupid questions, only stupid answers! >
The purpose behind the scaling was go grow the laser in the direction being fired. Idealy, I want the laser to continue to grow until it hits an object or times out. Once this happens the laser would be destroyed frm back to front.

Can you provide a further explaination about how I would use 3 quad planes placed like a cross? I am having trouble picturing how this would work?

Thanks
Moved thread to graphics forum...

This topic is closed to new replies.

Advertisement