PDA

View Full Version : Cone in Cpw



roh
02-07-2002, 10:23 PM
I'm new to OpenGL and Cpw.
I can easely draw primitives (spheres, circle, torus etc.) using Cpw, ** BUT A CONE **. My settings are:
CPW_PRIMOPT_SIZE, 1.0
CPW_PRIMOPT_RADIUS, 1.0
CPW_PRIMOPT_INNERRADIUS, 0.5
CPW_PRIMOPT_OUTERRADIUS, 1.0
CPW_PRIMOPT_TOPRADIUS, 1.0
CPW_PRIMOPT_BASERADIUS, 1.0
CPW_PRIMOPT_WIDTH, 1.0
CPW_PRIMOPT_HEIGHT, 1.0
CPW_PRIMOPT_SLICES, 20.0
CPW_PRIMOPT_STACKS, 20.0
CPW_PRIMOPT_SCALE, 1.0

I tried other values as well. I assume I'm making a newbie error. Which one??

roh

jmathies
02-08-2002, 11:00 AM
Hey Roh,

Your right, you can't. I did a test and
realized some of the options you set for
cones were not correct. I've updated the
source, win32bins, and demo download on
the Cpw site.
http://www.mathies.com/cpw/

I also updated the overunder conformance
demo so it draws a cone for an example.
There are also a few new demos in the
'demos' dir, including a volumetric
fog demo and lightmap demo.

The correct way to do a cone is as such:

cpwSetPrimitiveOpt( cpw, CPW_PRIMOPT_BASERADIUS, 0.5 );
cpwSetPrimitiveOpt( cpw, CPW_PRIMOPT_TOPRADIUS, 2.0 );
cpwSetPrimitiveOpt( cpw, CPW_PRIMOPT_HEIGHT, 10.0 );
cpwSetPrimitiveOpt( cpw, CPW_PRIMOPT_SLICES, 20.0 );
cpwSetPrimitiveOpt( cpw, CPW_PRIMOPT_STACKS, 20.0 );
cpwDrawPrimitive( cpw, CPW_PRIM_3D_WIRECONE );

Hope this fixes your problem.

Regards,
Jim


[This message has been edited by jmathies (edited 02-08-2002).]