Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Familyfriend

#1
Projects / Die game
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:

  • 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

  • align( . . ): i read somthing in the forum about this method bu to be honest i can't get what to pass to the method, thre is one that wants an Object3D to align to and an other one that follow the camera.

  • i derived the X Y Z euler angle from the matrix and i applied them with the rotateX/Y/Z() method, that almost work except for a realy bad flickering of the die



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
#2
Support / Box
September 27, 2011, 11:25:04 AM
Hi,
I'm a new 3d graphic programmer trying to implement a simple application that shows a rolling dice from the acellerometer vector. I'm tring to do in 3D graphic with jCPT-AE and Jinnjine (http://code.google.com/p/jinngine/) as physic engine.

I have already implemented the walls and the die both in the physic and in the graphic world.
Now my problem is that i can't deal with the rotation connection, i have a Matrix4 from the physic world and i can't figure out how to
use it to rotate the graphic object.

tries:

  • 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
  • align( . . ): i read somthing in the forum about this method bu to be honest i can't get what to pass to the method, thre is one that wants an Object3D to align to and an other one that follow the camera.
  • i calculated the x Y Z angle from the matrix and i applied them with the rotateX/Y/Z() method, that almost work except for a realy bad flickering of the die

can someone help me, at least driving me to the right direction.


here is my code for the texture box: http://pastebin.com/W3xQhRtw
and the code for the frame: