As explained in this other thread, I’m currently trying to do laser beams in Away3D:
http://away3d.com/forum/viewthread/1155/
I know the way most 3D games do laser beams is with a texture on a quad, stretch the quad from shooter to target, and rotate the quad to face the camera.
I also know that Away3D has the Sprite3D entity for doing quads that face the camera. The thing is, Sprite3D always faces the camera completely, but for a laser beam I would want it to only rotate on one axis. That is, the laser would roll to face the camera, but the pitch and yaw would be independent of the camera.
How would I roll the quad to face the camera in this way? I’m assuming I’d do a little vector math using the orientation of the camera and of the quad, but I don’t know what exactly to calculate.
Alternatively, where is the code to face Sprite3D toward the camera? I want to look at the math there to figure out what I need, but I can’t tell where that code is. When I look in Sprite3D.as I don’t see anything that looks promising.
—-
Incidentally, does Sprite3D already have this functionality? While it seems to always rotate on all axes, and I need a quad that rotates only on one axis, perhaps I just missed in the documentation how to restrict Sprite3D to only rotating on the Y axis or something.