Jump to content

  • Log In with Google      Sign In   
  • Create Account


draw a torus?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 NovAdi   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 November 2001 - 08:21 AM

how i can draw with opengl (glut) a torus or has somebody an example of this? thx for answer

Sponsor:

#2 mkaltner   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 November 2001 - 08:29 AM

I know this can be done with glaux. If you have that you can use auxSolidTorus I think it is...

If not, then I don''t know, sorry.

- Mike

#3 Major   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 November 2001 - 08:33 AM

You can use these functions:
glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);

glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 29 November 2001 - 08:14 AM

a torus is simply circle swept in a circle around a center point. Psudeo code:

1. create a ring of vertices
2. offset ring to desired radius
3. rotate ring of vertices around the center (creating new vertices at each rotation)
4. connect the vertices to create the polygons (you can optimize this portion using indexed vertices or by stripping the triangles, maybe even use quads)
5. texture, light, render your newly made torus

learning to draw the torus may be a good idea if you are into math and dont want to start sing outside libs like glaux.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS