Q:

Angle to Vector3?

I am working on getting my directional lights to match the sun in my atmospheric scattering shader.
I have a float that ranges from 0 to 6.28 (TwoPi). How would I calculate a vector3 from this angle?
The reason I need an angle is because my light angle is created like this:
LookAt(new Vector3(100, 100, 100), Vector3.Zero, Vector3.Forward);

Thanks.

A:

The angle is an angle in 2D plane, correct? Then you need simple trigonometry: 
Vector3 myVector = new Vector3(Math.cos(angleFloat), Math.sin(angleFloat), 0);

Look at this image. In your case, V = 1. If you need vector in different plane, just switch the axes.

Note: The code is in Java, but whatever language you use, it should be very similar.

