View Full Version : Drawing on a surface

09-08-2006, 02:55 AM
It's my first time taking part in the forum, i tried to search about my question, but i didn't find it (maybe because my english is very poor).
My question is really simple: how can i draw a primitive on a drawn primitive? I mean, for example, i draw a sphere, and then i want to draw some lines on its surface, clicking with the mouse.
Maybe the solution is really easy, but i can't get it after a long a time.
Thanks in advance.

09-08-2006, 04:02 AM
draw some lines on its surface, clicking with the mouseThe simplest way would be to cover this sphere with texture and render to this texture, so it will not require a lot of OpenGL knowledge. However, math behind this will definitely require some programming skills.
For predefined shapes (box, sphere) it will be of average difficulty, but for complex meshes it will involve raycasting, ray-triangle intersections, world space to texture space coordinate transformation and some mechanism to ensure that line drawn by user will be drawn to all fragments of texture that are applied to polygons that this line occupies. Lots of work.
If you think you're up for this we can discuss this further.