• Advertisement
Sign in to follow this  

transforming a hemisphere

This topic is 2640 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

hi,

i have problem trying to transform my hemisphere based on the vertex normal. so what im trying to do is to build a hemiospehre of each vertex with radius 1. the hemisphere looks like this:

http://hinjang.com/articles/media/skyModel00.png

where the up value is the normal of each vertex. so for example if my vertex normal is (0, 1, 0) (y is the up value) i can simply use the normal hemisphere formula that can be found in here

http://en.wikipedia.org/wiki/Spherical_coordinate_system

(with few changes considering y is the up).

now the problem is when i have the normal not pointing up, eg :

normal = normalize(1, 1, 0)

how can i transform the hemisphere so it follows the normal of the vertex? so for example if i know all the point to build a hemisphere for normal (0, 1, 0), how can i find the coordinate for a hemispehre for normal normalize(1,1,0)?


thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Sounds like you are just needing a rotation.
You could for example get the cosinus of the rotation-angle by the dot-product of
(0,1,0) and normalize new_normal
Now you can get the rotation-axis by the cross-product of these two vectors.
That is all information you need for rotating the hemisphere right in place.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement