Archived

This topic is now archived and is closed to further replies.

Question about Lasers

This topic is 5706 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Why not use a billboard? 2 triangles aligned with the camera sure makes things faster for collision detection instead of using a whole cylinder!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites