Main Menu

Suggestions for Next Release

Started by AGP, August 16, 2006, 10:27:33 PM

Previous topic - Next topic

AGP

I don't understand one part of that first line. For starters, what's the invert for? It works exactly the same without it. And all I seem to get renderered is the bottom of my model. If I move the camera object over the model to try to get its top, even when I rotate the camera object 180 degrees, I don't get anything.

AGP

A quick update so you what I'm talking about: I can rotate the object, the object's pivot, and even mirror the object but I can't get the camera to face anywhere but up with your code.

What I've done instead is basically just set the camera to the invisible object's position and rotate it separately, but it would really help a lot if I could set a plane as the position of the camera and the camera face towards the plane's normals. I don't mean to ask too much and appreciate your time but if this is possible it would be very of you to show me.

AGP

Also a final suggestion: Object3D.addChild(Camera). Now that is cool.

EgonOlsen

The code works for me. It has to be called every single frame of course. Take the car example that comes with jPCT and put this

camera.setBack(car.getWorldTransformation().invert3x3());
camera.setPosition(car.getTransformedCenter());


at the very end of the moveCamera()-method and you'll see what it's supposed to do. If you are calling it every frame and it still doesn't work, please provide me with a test case that demonstrates the problem, so i see what's wrong.

About the addChild(<Camera>)...no, that wouldn't be cool, because it makes the camera part of the scene graph, which it shouldn't be by design. If you want that, do it yourself. The code above should do it. If it doesn't, well...then please provide me with the mentioned test case, so i can check this out.

AGP

Test case sent. Please prove me wrong because the code really doesn't seem to work. Thanks in advance.

AGP

Did you see it yet, Egon? Any suggestion?

Melssj5

Hi, I just have downloaded your code and barely checked it, I never have done something like a follower. And I have been bussy, but as now I am bored on my job lets see.

I could see you are calling to follow on each iteration

just set the cam position and after that move it the 600 units, I dont know why do you the 2 last lines of code.

I may check it on my house today.

So, which behaviour do you got?
Nada por ahora

AGP

Sorry about the confusion: what I sent you was just a quick-and-dirty little program in which the x-Wing doesn't even turn around. But you have to imagine the camera following the x-Wing turning constantly on screen.

Melssj5

Egon wont be here until 28th, in fact he disconnected just a few seconds before you sent the mail. bad luck I guess, but I suggest this.

do this on any iteration:

camera.setPosition (xWing.getTranslation ());

camera.moveCamera(Camera.CAMERA_MOVEOUT, 600);

camera.lookAt (xWing);


and  thats all, it should work. I cant test it bt is an idea. I couldnt check your code on my house . Hope this help.
Nada por ahora

AGP

Try it out. If it worked I would have done it. Trust me, following is complicated. But I appreciate the suggestion.