So I am writing a tool to position the sun in SkIndigo but I ran into a problem. I assumed that the <sundir> vector from the camera position to the sun was the same as the vector from the scene origin [0,0,0] to the sun. Apparently this is not the case.
This tells me that the position of the sun in Indigo is actually some fixed distance from the scene origin. So my question is this:
Given:
- Vector from camera to sun (direction only, not length)
- Vector from scene origin to camera (direction and length)
Determine:
- Vector from scene origin to sun (length not required)
This is probably very easy but I am a bit rusty on my 3D math...
Thanks!
Problems with sun position tool (vector math help)
Re: Problems with sun position tool (vector math help)
Well, sundir in Indigo is actually the vector from the origin to the sun. It's just that the sun is actually a finite distance away (the sky model is just a sphere around the scene).
Re: Problems with sun position tool (vector math help)
Could you please share the distance to the sun from the origin?OnoSendai wrote:Well, sundir in Indigo is actually the vector from the origin to the sun. It's just that the sun is actually a finite distance away (the sky model is just a sphere around the scene).
Re: Problems with sun position tool (vector math help)
It's basically 10x max radius of scene.
Who is online
Users browsing this forum: No registered users and 95 guests