entitypitch problem

Blitz3D Forums/Blitz3D Programming/entitypitch problem

Rook Zimbabwe(Posted 2005) [#1]
I have created a cylindrical mesh like the wheel on an old slot machine. I turn it using rotateentity. I view the rotation by using entitypitch...

But the number reports weird. I was expecting 0 to 359 as a report of the angle but it goes to 90 and -90 twice...

I assume it is because it assumes it is rotating a stick.

Is there a way to report the angle in 0 to 359 true? I was just going to try and code a simple slot machine.

Knowing the angle would let me check for SLOT!!!

-RZ


Shambler(Posted 2005) [#2]
You must be using a variable already to rotate the mesh by 'angle' degrees,

e.g. rotateentity wheel,angle,0,0,1 why don't you just use it rather than trying to retrieve the rotation using entitypitch?


KuRiX(Posted 2005) [#3]
This is a problem with Euler angles. See your other angles too, and you will notice that when the 90 value repeats, the pitch or roll is different.

good luck!


Rook Zimbabwe(Posted 2005) [#4]
Shambler... yes I am using a variable to rotate. I wanted to use that so I could TRACK the wheels rotation angle and use that to check if the wheel had certain combinations. You know... A slot machine like in Vegas. OR one of the older fruit machines in the U.K. same thing thereabouts.

Kurix... OK will check those. thought they would remain the same if I didn't set them.

{{EDIT}}
Nope... here is the weird thing:
I used 0 through 9 as numbers on the face of the wheel. The wheel is a b3d obbject (thanks to Ultimate Unwrap.)

# P R Y
0 72 180 -180
9 38 -180 180
8 0 180 -180
7 -38 180 -180
6 -65 180 -180
5 -65 0 0
4 -45 0 0
3 0 0 0
2 38 0 0
1 72 0 0

Now the numbers aren't perfect since I was just using the down arrow to rotate this BUT I cann see the pattern. Interesting how this works. I wonder if I can create a series that would rotate the entity to these parameters but would appear as it were rotating or spinning...

RZ

Thanks guys!


Rook Zimbabwe(Posted 2005) [#5]
Is there a transposition for euler angles?

I went here:
http://mathworld.wolfram.com/EulerAngles.html
and my head started to hurt.

-RZ


VIP3R(Posted 2005) [#6]
Rook, do what Shambler said - instead of converting the euler angles back to degrees just use a variable together with RotateEntity and track the variable value. If you have 10 positions on your wheel that would be 360 / 10 = 36 degrees for each position. So your wheel positions would be something like this:

0 = 0
1 = 36
2 = 72
...yada yada


Rook Zimbabwe(Posted 2005) [#7]
I did this:
Now I have to figure out some way to make it more random... THEN spin and slow down like a real slot machine.
-RZ


_PJ_(Posted 2005) [#8]
Standard Fruit machines have 12 'fruits' on each reel. These are spaced equally around the circumference every 30 degrees.

So to make the selection, speed up the rotation and slow it etc, just ensuring it comes to rest at a multiple of 30.

In fact, you can ensure it starts to slow at a multiple of, say 20, then take a further definite 160 degrees to stop.