WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dealing with 90 degrees, what would be the next step?

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
TiagoTiago



Joined: 20 Jan 2007
Posts: 710
Location: Brasil

Digg It
PostPosted: 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?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group