Advertisement

3D angle from 2 3D points

Started by March 02, 2001 12:32 PM
2 comments, last by redmonkey 23 years, 11 months ago
im sure its the same as its 2D equivelent, maybe, or does it involve more sin/cos mess? (and seeing as i cant remeber the 2D version, ill ask anyway) thanks for any responses __________________ graham "red" reeves. red@deadpenguin.org www.deadpenguin.org
__________________graham "red" reeves.[email=red@deadpenguin.org]red@deadpenguin.org[/email]www.deadpenguin.org
2 points in a 3D world give you a line. You need 2 lines to have an angle and therefore at least 3 points.
Advertisement
k, scratch that, i didnt need to at all :D

__________________
graham "red" reeves.

red@deadpenguin.org
www.deadpenguin.org
__________________graham "red" reeves.[email=red@deadpenguin.org]red@deadpenguin.org[/email]www.deadpenguin.org
okay, i dont mean to make it look like im trying to keep this at the top, but i *do* need this :/

im using a bunch of functions, one, that calculates the positon on my sphere, based on a radius, that gives me a vector, which is the position of a corner of a quad or something to put on the surface. thats how the following is done, i increase the radius, then join up the points to turn it into a cube (the white ones)


to get the normal (the lighting) i can just use the vector i got to get the corner of the quad/posiiton of the point on the surface.

when i apply this to rotation:
glNormal3fv (posp);
glRotatef(posp[0],1.0f, 0.0f, 0.0f);
glRotatef(posp[1],0.0f, 1.0f, 0.0f);
glRotatef(posp[2],0.0f, 0.0f, 1.0f);

the normal is fine, but the scene wont rotate at all.
hence the fact those cubes (the coloured ones) are rotated at the same angles as the scene

if anyone can really help (some expierence maybe) and want to go deeper to help me (get the source) icq me #13548542 or email me (below)

__________________
graham "red" reeves.

red@deadpenguin.org
www.deadpenguin.org
__________________graham "red" reeves.[email=red@deadpenguin.org]red@deadpenguin.org[/email]www.deadpenguin.org

This topic is closed to new replies.

Advertisement