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 - gabriel_mb1

Pages: [1]
1
Bugs / Camera.CAMERA_MOVEUP, Camera.CAMERA_MOVEDOWN - bug?
« on: January 07, 2007, 01:31:33 am »
Thanks Egon,
understood!

I'll try to do the camera follow a dummy rotating object as Sebastian did and I'll also try as Melssj5 did, rotate the camera around a dummy object. Both should work fine. (I'll use a dummy object because the pivot I want is not necessarily in any object of the world).

Thanks Egon, Melssj5 and Sebastian.

Gabriel

2
Bugs / Camera.CAMERA_MOVEUP, Camera.CAMERA_MOVEDOWN - bug?
« on: December 31, 2006, 03:47:08 pm »
Yes I know that this code is bad for the intention. What I want is an OrbitCameraAroundPivot thing. I'm working on it. The basic code I wrote doesn't really orbit, because the camera will be far and far from the pivot at every single movement, but it was simple and as I'm learning jPCT and Java, better do simple things first.

What I wanted with this thread is to tell you about this apparently inconsistent behavior, because it works fine in all directions but when it crosses the Y axis (it apparently twists the camera 180 degrees).

Is this lookAt() behavior particular to cameras or it will do this with object3D too? Is this related to that the rotation of a camera actually rotates the world, not the camera? Is this related only with the Y axis or it can occur in other circumstances? Is there another way to look at something don't using lookAt()? So many questions, sorry.

I saw the code in Car example and it has another aproach to do the orbit, I'm working on it to do some more generic orbit "function" (I told I'm new on Java, ok - method?). I'm also working with the mirror thing that athanazio wrote in another thread. Cameras, cameras and more cameras. The mirror works fine at the moment but needs work on the reflection angle, for now it does only perpendicular reflection. It's hard to work with cameras as we can't parent them, we can't rotate them along a given pivot, or can we and I didn't find it?

Thanks for this great API and support,

Gabriel

3
Bugs / Camera.CAMERA_MOVEUP, Camera.CAMERA_MOVEDOWN - bug?
« on: December 31, 2006, 01:42:55 am »
Hi Egon, I'm new here and playing around Java and jPCT for a few weeks.

I was playing with the camera and found something like a bug or
at least a different behavior on the Camera.CAMERA_MOVERIGHT, Camera.CAMERA_MOVELEFT X
Camera.CAMERA_MOVEUP, Camera.CAMERA_MOVEDOWN


I used this code to rotate the camera around the center of the World:

Code: [Select]

                if (rotleft) {
                    theWorld.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, zoomSpeed);
                    theWorld.getCamera().lookAt(SimpleVector.ORIGIN);
                }
                if (rotright) {
                    theWorld.getCamera().moveCamera(Camera.CAMERA_MOVELEFT, zoomSpeed);
                    theWorld.getCamera().lookAt(SimpleVector.ORIGIN);
                }
                if (rotup) {
                    theWorld.getCamera().moveCamera(Camera.CAMERA_MOVEUP, zoomSpeed);
                    theWorld.getCamera().lookAt(SimpleVector.ORIGIN);
                }
                if (rotdown) {
                    theWorld.getCamera().moveCamera(Camera.CAMERA_MOVEDOWN, zoomSpeed);
                    theWorld.getCamera().lookAt(SimpleVector.ORIGIN);
                }

It's not a beautiful code but I'm still learning how the engine works.

and what I got is that when I rotate right or left, it's ok, but
when I rotate up or down, there is a jump when the camera is crossing the Y axis. (Or the XY plane of the world)

Seems that the code behavior of MOVEUP, MOVEDOWN is different from MOVELEFT and MOVERIGHT.

Congratulations for your engine, it looks fantastic!

Thanks, and Happy hollidays!

Gabriel

Pages: [1]