jPCT-AE - a 3d engine for Android > Support

[Tips] How to use the orientation sensors to set the JPCT camera to corrispond

<< < (2/2)

hi nimo,
i followed your steps for senser value passing but final result is just a black screen,is it due to other cam parameters?
can you share your rendering code as i am new to jpct and it will be a great help.

I would highly recommend using Sensor.TYPE_ROTATION_VECTOR instead of the others. It automatically combines the sensors and applies low pass filtering, producing a smoother result similar to the Google camera's photosphere, although it may depend on sdk version used (API 9+).
It also combines gyro data and handles devices without gyroscopes by falling back to accelerometer only.

You can also do portrait mode by applying the appropriate remapping, I don't remember the exact mapping but can test it if people actually need it.

Hi Guys!

First things first, thank you for JPCT-Blend which I find very handful, and this forum.
In the frame of a master thesis, I'm currently working on a VR prototype.
For now, everything works fine and the way I want it to, except that the sample scene appears like it has been
rotated -90° on the Y axis in the Blender coordinates system.
I tried to remap the Sensor coordinate system to no avail.

I also tried the solution given by Paulo in this forum without success.
One solution I see would be to multiply the JPCT-View Matrix by the proper rotation matrix (i.e, +90° on the Z axis if I'm correct).
My question is: How could I do that in a clean way ?

Thanks for your help!

PS: I'm using this excellent work from Alexander Pacha to get the sensors fusion of the android device. It works incredibly well for VR:

I'm not sure, what exactly you mean. You actually want to rotate the camera 90° around it's (maybe transformed) z-axis? If so, you could do something like

--- Code: ---camera.rotateAxis(camera.getZAxis(), ...);

--- End code ---

Or isn't that what you meant?

Thank you so much for your quick answer!
I can't believe I spent hours on this one :)
I was doing a
camera.rotateZAxis(new simpleVector(0.0f, 0.0f, 1.0f), Math.PI/2) instead of
camera.rotateAxis(camera.getZAxis(), Math.PI/2)!

This is why the rotations were not good anymore after rotating the axis.

Everything is fine now, thanks a lot!
Bravo and thank you for JPCT-Blend :)


[0] Message Index

[*] Previous page

Go to full version