Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Geometric question: Tetrahedron and Cylinder

This topic is 6153 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 would like to know how can I obtain the coordinates of the vertices of a tetrahedron if I only have its center coordinates and the distance from the center to a vertex (the alignment could be with a face aligned with the X plane). And the same for a cylinder, given the center, the length and the radius. Maybe there are some links were I can find this?? Thank you, thank you! :o)

Share this post


Link to post
Share on other sites
Advertisement
The glu library has functions for shapes like these. gluSphere() and gluCylinder should help you in making these shapes, sorry I can''t be more specific as I have never used these functions, but check out NeHe''s tutorials on using them.

FatalXC

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
A tetrahedron has 4 vertices equally spaced from the origin:
( 1, 1, 1 )
( 1, -1, -1 )
( -1, 1, -1 )
( -1, -1, 1 )

Want a unit sphere? Just normalize them. Not sure how to
align a side to a major axis. Probably have to rotate
those points a bit.

A cylinder is just two 2D circles attached together.
Use the equation to get a point on a circle:

x = r * sin(angle_rads);
y = r * cos(angle_rads);

Share this post


Link to post
Share on other sites
A tetrahedron can be thought of as a low detail cone. (a cone being a tapered cylinder). For a regular tetrahedron (all points equidistant from the center) your points would be:

1: 0,sin(90),0
2: sin(0),sin(-30),cos(0)
3: sin(120),sin(-30),cos(120)
4: sin(240),sin(-30),cos(240)

multiply all these values by the radius you''re looking for.

As a generalized cone, you could say the height is (1+sin(30))*radius. The number of sections to draw is 3. I think there''s a cone drawing scheme in glu.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!