jit.gl.model camera perspective

kcoul's icon

Quick question on how to adjust the camera perspective of a loaded character from 3rd person perspective to first person perspective. Something like how it is about 1:15 of the way into this video:

Thanks!

chrisoconnor's icon

Well the simple bit would be setting the position of the camera, as you would just send the Kinect x.y.z position for the head, and feed this (packed) into a (position $1 $2 $3) message going into the jit.gl.camera object.

However the hard part is the view of the 1st person, trying to get the camera to rotate with the head. As far as I use the Kinect (I use Synapse as middle-ware), I wouldn't be able to map the rotation of the head, so I would have to try and work out some math around the shoulder positions -> rotation conversion. However if you are using other means of retrieving the Kinect data, then see if you can get the rotation of the head, and do the same as before.

hope that helped

-chris

Rob Ramirez's icon

the gl.camera orientation can be set in one of 6 ways:
@rotate (angle-axis)
@rotatexyz (euler)
@quat (quaternion)
@lookat
@direction

you need to determine what format the rotation is coming from the device, and translate that to one of the options above.

also, the jit.quat object will allow you to specify x, y, and z axes, and give you the quaternion values from those axes.

kcoul's icon

Thanks this info really helps, the good news is that I'm not going to try to get the head tracking part to work, I'm going to use the joystick on the Wiimote nunchuk for that purpose instead. (panning the joystick while holding Z will turn the camera and head of the model up to a natural constraint limit, whereas panning without holding Z will trigger the turning animation and rotate the camera endlessly in both directions).

My only other question for now would have to do with collision detection - how are collisions detected and handled in Jitter 6? I'm working with .b3d at the moment.

Anyone know of relevant threads and/or tutorials? Thanks!

Rob Ramirez's icon

for collision detection you can use the jit.phys family of objects.

jit.phys.world @dynamics 0 will make the physics engine perform only collisions.

take a look, and ask any specific questions you have to the forum for more help.

chrisoconnor's icon

Hey,

I wanted to explore what you were after doing originally, and came up with this little patch which works out the difference between the shoulders to create rotation.

If you're carrying on with the nunchuck joystick though thats cool ;)

Max Patch
Copy patch and select New From Clipboard in Max.

enjoy

kcoul's icon

Thanks Chris! Actually I have to experiment a LOT before I decided the mapping scheme I'm going to dump a lot of time into, so this really helps! I've just been working now to set up the basic hardware for the experiment, which it turns out is not so basic.

I'm going with a 3-monitor setup of equal size for peripheral vision because I have not seen an HMD headset on the market yet that I feel would be worth the $, though 2012 might reveal the first half decent HMDs appearing on the market.

The point is to thoroughly test the gestural/surround sound framework I'm working on before releasing it (it'll be open source for Mac and Windows), that is designed to interact gesturally with sound objects in 2D/3D space, with or without graphics representing those objects in 2D/3D space as well. I've explored applications of it as a DMI this past year, now I'd like to explore the possibilities for gaming. I'm hoping to model an interactive environment in Jitter that I can later rebuild in Panda 3D

Anyways, thinking about it a bit more, I will probably try to use head tracking for peripheral panning and the joystick for full body rotation. It's a shame only Sony makes the hardware to do all this on one manufacturer's set of hardware but make it so hard to develop using their stuff. Right now I'm finding Kinect and Wii hardware together to be a great combination.

So that code will be useful - thanks!