# OpenGL Projecting a Straight Triangle on a Sphere

This topic is 4450 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello All. An interesting task for me. I am given a planar triagnle and I need to project it on the surface of a sphere of known radius "R". I also know th distance between the center of the sphere and the point closest to the sphere's center perpendicularly, lying on the triangle. How to realize the projection in OPenGL? [In short I need to make a spherical triangle.] All right I make my task simpler. I need to project a striaght line segment on a curved surface with known radius of curvature. How to do in OpenGL ? Is this have some connection with using NURBS?Or I will have to do it mathematically and then write a code for it?

##### Share on other sites

OpenGL isn't really related to your problem, unless you are trying to solve the problem somehow graphically. OpenGL can be used to visualize the resulting patch however.

Perhaps this is a special case, but you could do line-sphere intersection test from each vertex of the triangle to the center of the sphere. This way you would find the three points which lay on the sphere and very easily you could calculate the normals / tangents for each vertex.

this is the end of my knowledge ... as far as I know, you should be able to create a higher order surface with this information.

I can't help it, but this sounds a bit like a school assignment ...

Cheers

1. 1
2. 2
frob
12
3. 3
4. 4
5. 5
Rutin
10

• 13
• 14
• 65
• 14
• 15
• ### Forum Statistics

• Total Topics
632130
• Total Posts
3004283

×