www.jpct.net

jPCT-AE - a 3d engine for Android => Projects => Topic started by: Familyfriend on September 27, 2011, 03:46:16 pm

Title: Die game
Post by: Familyfriend on September 27, 2011, 03:46:16 pm
Hi,
I'm a new 3D graphic developer. I stater looking at it only few weeks ago, i decided to try to implement a simple die game wich you can roll a 3D die shaking the phone.

I downloaded jCPT-AE and a physic engine called Jinngine.
I managed to implmenet walls and the cube but my problems start when i have to translate the physic cube ( the die ) state to the graphic wolrd.

I made it going around with the translate method but i can't figure out how to set the rotation matrix to the 3D object.

i've been tring in a few ways but i can't work around it:



can anyone help me or at least share his knowledge on what i'm tring to do?
it shouldn't be the most task difficult ever, i mean, i do have a 4x4 matrix rappresenting the rotation of the physic object so i guess i just missing something in between the translation.

thx in advance
Title: Re: Die game
Post by: firstdeathmaker on October 13, 2011, 09:50:24 am
Quote
setRotation(Matrix m ):  it didn't work cause of some strange rendering of the box, after the rotation it came out streched and only half visible

Maybe the order of the physics matrice is another one than in jpct? Remember, jpct works with a coordinate system that is different from what is usual in mathematics: http://www.jpct.net/wiki/index.php/Coordinate_system (http://www.jpct.net/wiki/index.php/Coordinate_system). That did confuse me also.