maybites / NodeOSC

blender OSC addon to be used with nodes
GNU General Public License v3.0
123 stars 18 forks source link

Rotation data Is not correct when sending gyroscope data from mobile device... #11

Closed JohnMama12 closed 3 years ago

JohnMama12 commented 3 years ago

Hello, I have downloaded the Sensor2OSC on my phone to send gyroscope data to rotate my camera with NodeOSC But my only issue is that the camera rotates like crazy: Here are the message handlers I have set: msghandle and here is a video showing what's happening:

https://user-images.githubusercontent.com/80211498/113948033-5c303b80-97e2-11eb-8249-882e0129f4ae.mp4 this is me rotating my phone in a almost circular motion

maybites commented 3 years ago

you only need one handler for this: set the datapath to:

bpy.data.objects['Camera'].rotation_euler

since you set args[idx] to

(0, 1, 2)

you will set the rotation vector in one go.

JohnMama12 commented 3 years ago

you only need one handler for this: set the datapath to:

bpy.data.objects['Camera'].rotation_euler

since you set args[idx] to

(0, 1, 2)

you will set the rotation vector in one go.

Ha! did not even know that!

JohnMama12 commented 3 years ago

bpy.data.objects['Camera'].rotation_euler

This Also works but it's very jittery and basically unusable. It's like too sensitive it and it moves by the wrong axis's

JohnMama12 commented 3 years ago

Yeah, I tried it on a cube but still very bad.. Also if I rotate my phone Up and down it's like something prevents it's from moving in the 3d viewport in blender.. I just try to rotate it by that axis but it stops basically making it unable to rotate by that axis...

JohnMama12 commented 3 years ago

Update: I tried using rotation vector instead I got better results but not exactly the best either.. I had to manually adjust the position of the camera etc.

maybites commented 3 years ago

since I don't have your app installed, I can't test it myself. make sure the data your app sends actually makes "sense" and is in the right format.