@Donald Smith
Since you are already considering using 3d (a plain object) to make your wheel, you can take it a step further and build your wheel out of triangles with very little code. The following snippet explains the steps in detail as well as providing the actual code. For controlling the spinning, you can look to LBFN's code.
sync on
sync rate 60
remstart
a circle has 360 degress. The wheel of fortune is made up of a
bunch of pie slices that make up the circle. Our goal is to
make a similar pie. How many slices do we want? For our demo,
we'll keep things nice and easy. We'll say we want 10 slices.
Our slices are going to be triangles. In order for our triangles
to be the right size, we have to take everything we know and
want to know about our circle and apply it to each slice.
1. We have ten slices
So, if a cicle has 360 degrees, each of our slices can only
be 360/10 degrees or 36 degrees wide.
2. How big across do we want our wheel (diameter)? We'll
make that nice and simple also. We'll say 20 units. Now, if
20 is the diameter, then the radius must be half of that. Our
radius for the circle is 10 units.
3. What do we now know?
a. Our circle has 10 slices - each 36 degrees wide
b. Our radius is 10 units
c. If our circle's center is located in 3d space at (0,0,0),
then each slice of pie will point at (0,0,0) at it's butt
will be 10 units away (radius)
remend
rem make a triangle
rem the first point of the triangle will at the origin - (0,0,0)
x1#=0 : y1#=0 : z1#=0
remstart
If each triangle can only be 36 degrees wide, then from the center
point, the 2 points that form the butt are each 18 degrees above,
and 18 degress below the center point.
In 3d space in DBC, the x axis runs right and left, the Y axis runs up
and down, and the z axis runs into and out of the screen. We will
be drawing the triangles so we can see them flat. That means we will
be drawing them in the X and Y plane.
So, if the first point of the triangle is at (0,0,0) then the point
above it is going to be +18 degrees and the point below it will
be -18 degrees (360-18 = 342). Our radius is 10 units. So to
calculate the butt of the triangle:
remend
slicecount=10
angle#=360.0/slicecount
upang#=angle#/2.0
downang#=360-(upang#)
radius#=10
mainslice=1 : rem a vaiable to identify the main triangle object
rem top
x2#=radius# * cos(upang#) + x1#
y2#=radius# * sin(upang#) + y1#
z2#=0
rem and for the bottom
x3#=radius# * cos(downang#) + x1#
y3#=radius# * sin(downang#) + y1#
z3#=0
rem put it all together and draw our triangle
make object triangle mainslice,x1#,y1#,z1#, x2#,y2#,z2#, x3#,y3#,z3#
remstart
A mesh is the math behind a 3d object. It's all of the points,
how the points are connected, how textures will appear on the object,
how light will react to the object, etc. We can't see the mesh, we
can only see the object that the mesh makes. That means we can make
many objects from the same mesh. This brings up the idea of limbs.
A limb is an object that is connected in some way to another object.
Like the limbs on your body. We can make limbs for an object
by using a mesh. We have built a triangle object that we'll use
for our wheel. Since all of the slices of the wheel are the same
size, we can use that 1 triangle over and over again to build
the rest of the wheel. We need that triangle's mesh first. Once
we have the mesh, we can build the other 9 limbs we need.
remend
rem get the nmesh from the triangle object
trianglemesh=1
make mesh from object mainslice,trianglemesh
rem now, using that mesh, we can add limbs to the object. We need 9
rem more triangles so we will add 9 limbs in sequential order
for lmb=1 to slicecount-1
add limb mainslice,lmb,trianglemesh
rem remember we are making a circle and each trangle has to be rotated
rem at 36 degrees. So let's rotate the limbs as we go
rotate limb mainslice,lmb,0,0,angle#*lmb
next lmb
rem for a wheel of fortune wheel, we would like each limb to be a different color
for lmb=1 to slicecount-1
color limb mainslice,lmb,rgb(rnd(255),rnd(255),rnd(255))
next lmb
sync
do
rem slowly rotate the wheel
zrotate object mainslice,wrapvalue(object angle z(mainslice)+1)
sync
loop
What's nice about this code is, you can change the value of slicecount and it will recalculate all of the triangles and angles that you need.
Enjoy your day.