Sign in to follow this  
akhin

Radiosity Mesh Baking : Camera Up vectors

Recommended Posts

Hi ,

I am using hemicubes to compute incident light ( form factors ) in my radiosity renderer.
So my renderer requires `up` vectors ( for creating view matrices for cameras per patch)
along with `normal` vectors per surface.

Considering model files ( x,3ds,obj etc) which ones supply those `up` vectors ?
Or if they not , how can I calculate an up vector by using center of a patch
(averaging 3 vertices of a polygon-patch) and the polygon normal ?

thanks

Share this post


Link to post
Share on other sites
I don't know which model formats specifically allow to store this, but I guess you could use the tangent vector as an up direction for the camera. If you don't have access to the tangent from the model, you can calculate it yourself, using a method like [url="http://www.terathon.com/code/tangent.html"]this[/url].
I am curious btw how important the choice of up vector is in this scenario, because it seems like it should not matter as long the camera is pointing in the right direction.

Share this post


Link to post
Share on other sites
If you really need a consistent frame of reference you can use the tangent frame, but typically you only need this if you're baking to a basis that's oriented about a hemisphere (like H-basis, or HL2 basis). For most cases you can just generate an up vector by picking a direction perpendicular to the normal.

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1314040282' post='4852455']
If you really need a consistent frame of reference you can use the tangent frame, but typically you only need this if you're baking to a basis that's oriented about a hemisphere (like H-basis, or HL2 basis). For most cases you can just generate an up vector by picking a direction perpendicular to the normal.
[/quote]

Yes I see , as long as `up` vector is perpendicular to the normal it will be ok

but now then my question is how can I calculate those perpendicular vectors ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this