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.


Messages - pieps2000

Pages: [1]
1
Support / Re: jPCT-AE together with own OBJ parser, rotations
« on: January 09, 2012, 08:36:44 pm »
That explains it. I missed already the forest for the trees. Many thanks for your fast answer. I will try it.

2
Support / jPCT-AE together with own OBJ parser, rotations
« on: January 09, 2012, 05:48:14 pm »
Hello,

I'm using jPCT-AE together with an own OBJ parser because I also would like to render the outlines of the 3D model and I woud like to use some functions of jPCT-AE. That means: At first the 3D model (OBJ) gets parsed and rendered by jPCT-AE. And then I extract the outlines of the model with another OBJ parser and that other OBJ parser draws the outlines with GL_LINES then. After that, in the onDrawFrame function, I would like to rotate the jPCT-AE cam around both models. It only works for the 3D model which got parsed by jPCT-AE because it's an own world. Somehow the outline model is at the location of the cam then and both (outline model + cam) rotate around the 3D model. I moved already the outline model back at the coordinates of the 3D model. Now I have only a problem with the rotation of the outline model which still rotates with the cam. In other words: It looks from the view point (cam) that the 3D model rotates. But it doesn't look from the view point that the outline model rotates. I have to substract the rotations of the cam on the outline model now again.

I tried it with:
//mObject gets parsed and drawed by jPCT-AE via Loader.loadOBJ() and Object3D.mergeAll()
cam.setPositionToCenter(mObject);
cam.rotateCameraX(-rotx);
cam.moveCamera(Camera.CAMERA_MOVEOUT, 8.f);

And I tried to compensate it for the outline model with:
//outlineObject gets parsed by an own OBJ parser
gl.glTranslatef(0.f, 0.f, -8.f);  // works
gl.glRotatef(xrot, 1.f, 0.f, 0.f);  // doesn't work because of different interpretation of the angle, it rotates slower than mObject on the screen
outlineObject.draw(gl);

It seems for me that cam.rotateCameraX(-angle) calculates the angle in another way than gl.glRotatef(angle, 1.f, 0.f, 0.f).
Is there an easier way to set the same angle for both cam and outline model? I calculated already between radiant and degree, but it didn't work.
Which type of angle does cam.rotateCameraX() need?

Or do I have to calculate the origin angle back from cam.getBack() which is a little bit more difficult?

I can read answers in German and English language. Many thanks in advance!

Pages: [1]