jPCT - a 3d engine for Java > Bugs

Camera alignment error?

(1/2) > >>

mystara:
Howdy,

I've been experiencing a weird effect when I do:

--- Code: ---camera.align(someObject3D);

--- End code ---

In one particular case, it seems to cause the light level of my world to dramatically fall. Objects don't appear unless the camera is pointed directly at them and is close up. For example, the following screenshot occurs by carrying out the camera alignment (above):



If I manually reset and rotate the camera in this way:

--- Code: ---camera.getBack().setIdentity();
camera.rotateCameraY(someObject3D.yRotationAngle);
camera.rotateCameraX(someObject3D.xRotationAngle);

--- End code ---

The shot appears (correctly) like this:



Obviously I've resolved my problem by finding another way to do what I wanted to achieve, so it's not urgent.
But I thought someone here might like to know on the off chance that it's a bug in jpct. I cannot understand how aligning the camera would affect the light levels. But since that's the only line of code I'm changing, I can't see what else it would be.

EgonOlsen:
It's a bug. It's caused by the fact that jPCT codes scaling directly into the rotation matrix. The align-method took this matrix, inverted it and used it as the new rotation matrix for the camera. This has to take scaling into account which it didn't. This build may fix it (untested): http://www.jpct.net/download/beta/jpctapi_119pre2_5.zip

mystara:
Does this version also incorporate the fix from:
http://www.jpct.net/forum2/index.php/topic,1427.0.html ?

EgonOlsen:
Yes.

mystara:
That seemed to fix the problem.

Out of curiosity, is there any significant difference in efficiency between:

camera.getBack().setIdentity();
camera.rotateCameraY(someObject3D.yRotationAngle);
camera.rotateCameraX(someObject3D.xRotationAngle);

or

camera.alignTo(someObject3D)

?

Navigation

[0] Message Index

[#] Next page

Go to full version