03-13-2001, 06:18 AM

I need to make a cylinder does anyone

have any ideas??

thanks

Greg

have any ideas??

thanks

Greg

View Full Version : How do you make a Cylinder??

03-13-2001, 06:18 AM

I need to make a cylinder does anyone

have any ideas??

thanks

Greg

have any ideas??

thanks

Greg

Teofuzz

03-13-2001, 07:58 AM

Two ways:

- using glut (quadrics)

- doing math

You can do the two circles with a triangle fan, describing the points on the xz plane in this way:

x=ray*cos(theta)

z=ray*sin(theta)

where theta is (current slice)*360/(number of slices).

The y coord depends by the height and the 'offset' form the origin.

The side faces can be done with quad or tri strips using the points already calculated.

The normals... well there you need more math.

bye!

tFz

- using glut (quadrics)

- doing math

You can do the two circles with a triangle fan, describing the points on the xz plane in this way:

x=ray*cos(theta)

z=ray*sin(theta)

where theta is (current slice)*360/(number of slices).

The y coord depends by the height and the 'offset' form the origin.

The side faces can be done with quad or tri strips using the points already calculated.

The normals... well there you need more math.

bye!

tFz

Powered by vBulletin® Version 4.2.3 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.