TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Mon May 21, 2007 7:59 am Post subject: dealing with 90 degrees, what would be the next step? |
|
|
to try to help me understand what happens when one of the axis reach 90 degrees I made the following script:
| Code: | if(Wiimote1.RawAccY>=0) then
var.angle1= atan (Wiimote1.RawAccX /Wiimote1.RawAccY) +90
else
var.angle1= atan (Wiimote1.RawAccX /Wiimote1.RawAccY) +180 +90
endif
if(Wiimote1.RawAccZ>=0) then
var.angle2= atan (Wiimote1.RawAccX /Wiimote1.RawAccz) +90
else
var.angle2= atan (Wiimote1.RawAccX /Wiimote1.RawAccZ) +180 +90
endif
debug = var.angle1
if(Wiimote1.RawAccY>=0) then
var.angle3= atan (Wiimote1.RawAccZ /Wiimote1.RawAccY) +90
else
var.angle3= atan (Wiimote1.RawAccZ /Wiimote1.RawAccY) +180 +90
endif
cursor1.visible= TRUE
cursor1.CursorPosX = screen.Width/2 + (sin(var.angle1+90)* 100) + 200
cursor1.CursorPosY = screen.Height/2 + (cos(var.angle1+90)* 100)
cursor2.visible= TRUE
cursor2.CursorPosX = screen.Width/2 + (sin(var.angle2+90)* 100)
cursor2.CursorPosY = screen.Height/2 + (cos(var.angle2+90)* 100)
cursor3.visible= TRUE
cursor3.CursorPosX = screen.Width/2 + (sin(var.angle3+90)* 100) -200
cursor3.CursorPosY = screen.Height/2 + (cos(var.angle3+90)* 100) |
can anyone help me figure out how to transition from one axis to the other when the angle measurements of one fo them gets imprecise cause the other is at 90 degrees?
ps: if it wasn't clear, yes I know that you can only get 2 axis with precision, what I'm trying to do is switch which real axis measures which virtual axis, transition the axis that is getting distorted into the third axis that would be getting less distorted...was this clear enough? _________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|