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

Messages - Familyfriend

#1
Support / Re: Box
September 27, 2011, 08:51:55 PM
yes, it is a world transformation matrix. My problem was that the setRotation matrix take a 4x4 matrix and i didn't know how to build it by the 3x3 matrix i could take from the physic object.
however thx a lot for your help and actually you answeard a lot of my question with this last answear.

I read something about the world transformation but i  couldn't understand how all the information could be stored just in one matrix. :D
#2
Support / Re: Box
September 27, 2011, 06:39:51 PM
mmm actually after you made me looking at the values of the matrix i noticed that it actually was not raw-major.

probably i made some mistake ( noob  :o ) in the code before because now i tried back to transpose it, and it works fine.

thanks for the help.
#3
Support / Re: Box
September 27, 2011, 06:23:13 PM

| 4.999999983927641     | 1.3521203987884335E-5  | -4.0067538875552356E-4 | -0.04895554408488278   |   
| -1.353701522130874E-5 | 4.999999996088675      | -1.9730685900529323E-4 | -0.0012040176435942087 |   
| 4.0067485487683144E-4 | 1.9730794316082318E-4  | 4.999999980052924      | 46.82875954697466      |
|     0.0               |     0.0                |     0.0                |     1.0                |

09-27 18:04:20.241: INFO/Matrix(3304): [0][0]4.999999983927641
09-27 18:04:20.256: INFO/Matrix(3304): [0][1]1.3521203987884335E-5
09-27 18:04:20.256: INFO/Matrix(3304): [0][2]-4.0067538875552356E-4
09-27 18:04:20.256: INFO/Matrix(3304): [0][3]-0.04895554408488278
09-27 18:04:20.256: INFO/Matrix(3304): [1][0]-1.353701522130874E-5
09-27 18:04:20.256: INFO/Matrix(3304): [1][1]4.999999996088675
09-27 18:04:20.256: INFO/Matrix(3304): [1][2]-1.9730685900529323E-4
09-27 18:04:20.256: INFO/Matrix(3304): [1][3]-0.0012040176435942087
09-27 18:04:20.256: INFO/Matrix(3304): [2][0]4.0067485487683144E-4
09-27 18:04:20.256: INFO/Matrix(3304): [2][1]1.9730794316082318E-4
09-27 18:04:20.256: INFO/Matrix(3304): [2][2]4.999999980052924
09-27 18:04:20.256: INFO/Matrix(3304): [2][3]46.82875954697466
09-27 18:04:20.256: INFO/Matrix(3304): [3][0]0.0
09-27 18:04:20.256: INFO/Matrix(3304): [3][1]0.0
09-27 18:04:20.256: INFO/Matrix(3304): [3][2]0.0
09-27 18:04:20.256: INFO/Matrix(3304): [3][3]1.0



here is the rotation matrix i get from the physicWorld, i'm sorry but i can't find the way to set a fixed angle to the physic object, anyway this is the rotation Matrix of the object just after the first bounce on a plane at  (0,0,50) without any rotation.

i hope this is enought.
#4
Support / Re: Box
September 27, 2011, 04:33:58 PM
i tried to transpose it but it doesn't change anything.
here below there is an image of what i get after i use the setRotation(Matrix m) method on the die.

render result: http://ge.tt/94IrXC8/v/0

does it make you think at some issue in particular? I'm thinking at some GL configuration i'm missing or even at some wrong verticies, that's why i posted you the TextureBox class code.

anyway thx for you help.
#5
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
#6
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:
#7
Support / Re: GetRotation() help
September 26, 2011, 12:47:16 PM
ok, i'm tring to implement a die with physic. I have from the physic framework a Matrix4, how should i use the aling()  method?
I expeted to find a align( Matrix m ) method but there isn't one so how can i apply a Matrix to an object3D by align()?

this i probably a dumb question, but you know, i'm new to 3D graphic and physics as well ^^.


EDIT:
i've been tring with setRotation() method but then it shows only part of the texture.
To show the die i'v implemented  a cube extending Object 3D, any face of the cube is made of 2 tringles defined by clock wise verticies and has a different  texture.
Do i need to do something in the object3D initialization or you think it's just a rotation mistake?
i have to add that when i rotate with the camera around the object i can see all the faces without any texture problem, the problem seems to be when i try to rotate the object3D itself.


Thx in advance for the response