Cylinder / Sphere mesh generation

Does anyone know of source code to place cylinders and spheres of radius R at specified coordinates [(X,Y,Z) for spheres and (X1,Y1,Z1,X2,Y2,Z2) for cylinders]?

I don’t want to use the glu routines, since I need different textures at various points on the objects.

I guess constructing them using triangle meshes would be best, but the working out vector math is beyond me.

Many thanks,

Rich Gilbert

hmmm this might not help at all, but have you looked into quadratics(sp?) ?

I have some old c source that does this. Give me your email and I’ll mail it to you. Also check out the FAQ for comp.graphics.algorithms

Fantastic - that’ll save a lot of time.

Thanks very much.

e-mail: r.gilbert@ic.ac.uk

Originally posted by harsman:
I have some old c source that does this. Give me your email and I’ll mail it to you. Also check out the FAQ for comp.graphics.algorithms

Can you mail me codes to Draw Circle, Cone, and Cylinder using quads?

I’ll mail you code to draw cylinders, you should be able to hack that to get cones (just replace the circle at one end of the cylinder with a single vertex) and disks/circles.