Pak rotatexyz problems. Unintuitive movements on Y axis, using Kinect

Aug 3, 2012 at 1:07pm

Pak rotatexyz problems. Unintuitive movements on Y axis, using Kinect

Hello there,

Im working on an interactive project using a Kinect. With body gestures people can rotate a large projected global sphere, everything on that side is pretty much fine. The problem i’m having is with the Y axis. The pak rotatexyz object sends the orientation of the 3d object to my jit.gl.gridshape object. The X axis always behaves as you would expect but depending on the position of the X axis the Y axis will behave differently. Its like it has to stick to its pole orientation and becomes very unintuitive to a user, as in a person swipes their hand up and down vertically and it moves like you’d expect but then the X axis will change 60 degrees or so and the same up down hand swipe will have a completely different effect.

Hopefully you can understand what im talking about.

Is there a different object i can use? or a way of simplifying, or a way of removing the “pole” of orientation from the Y axis.

Any help greatly appreciated.

Cheers

#63837
Aug 3, 2012 at 2:59pm

A patch would be really helpful.

#230209
Aug 3, 2012 at 4:05pm

Chris,

Sorry for not uploading in the first place, so, if you fiddle around with the rotation of the sphere manually (which has the same effect as hand gestures do via the Kinect) you can see that the result of changing the 1st int box will differ depending on the value of the second int box, making the cause and effect of the interaction seem unclear.

I zipped up the patch because there is a jpg needed for texture of sphere.

I hope this makes my problem more clear

Attachments:
  1. Yaxisproblem.zip
#230210
Aug 3, 2012 at 7:50pm

perhaps you want local rotations instead of world.
the rotate attributes of gl objects happen in world-space (meaning the rotation is the same, regardless of the objects local axes).

you can do local rotations by using the “anim_turn” message to jit.anim.node with @turnmode local.
i’ve added an jit.anim.node and a jit.anim.drive to your patch to allow you to perform the animation using the mouse in the jit.window.

i’m not sure if you’ll find this rotation more intuitive.

– Pasted Max Patch, click to expand. –
#230211
Aug 3, 2012 at 9:45pm

Thanks Robert,

The effect is exactly what im looking for but is there any way I can control the rotations without using the mouse, as in controlling the two axes with ints or floats?

Cheers

#230212
Aug 4, 2012 at 12:10am

rotatexyz to jit.anim.node?

– Pasted Max Patch, click to expand. –
#230213
Aug 4, 2012 at 12:35am

Thanks tobiasros, but that is essentially doing what I had before. the rotations when manipulated like this do not behave like i want them to, as in the spheres axes will change depending on its position and thus give different rotation results, as in not uniform interaction on both axes at all times

#230214
Aug 4, 2012 at 12:44am

@Robert

The Local rotations work perfectly for me when using the mouse, is there any way I can bypass using the mouse but still get the same results by manipulating integer boxes

#230215
Aug 4, 2012 at 1:57am

ah, i guess you are right, it seems that local rotations work only with the anim_turn message

(from the reference:
anim_turn x [float] y [float] z [float]
Rotate the node along each axis by the amount provided, relative to the space indicated by turnmode….

– Pasted Max Patch, click to expand. –
#230216
Aug 4, 2012 at 3:05am

this one with scaling…

– Pasted Max Patch, click to expand. –
#230217
Aug 4, 2012 at 3:48am

A different way of attacking this: The three number boxes at the top will work exactly like rotatexyz (though setting them all to 0 will not reset the object, but I think it should work for your Kinect purposes) only now they’re world-relative instead of object relative. Key points here are the @animmode attribute being set to ‘world,’ and only sending the delta (difference between successive inputs) to the anim_turn message. Also, pak is not the correct object to use for anim_turn (you wouldn’t want to change the message boxes to a single [pak anim_turn]) because you’ll end up rotating along axes you don’t expect (since pak will store the last number for its internal list, and output it again whenever any one of them turns).

– Pasted Max Patch, click to expand. –
#230218
Aug 4, 2012 at 4:11am

nice, with less objects and without uzi and pak is definitely better…

#230219
Aug 4, 2012 at 11:35am

Thanks MuShoo, that’s really great, perfect in fact

#230220

You must be logged in to reply to this topic.