Page 1 of 1

Camera support for Cut-Scenes

Posted: Tue Nov 21, 2006 10:15 pm
by filbert

current state

Posted: Tue Dec 05, 2006 6:07 pm
by filbert
Well, since we decided to drop the tracker project for a moment I started to work on the camera stuff.

The fading out to a black screen is almost done. Even that is not very difficult there are still some fixes to do:
  • The black screen disappears when shooting
  • The spaceship is still viewable
With a good event layer these problems can be handled.

Posted: Tue Dec 05, 2006 7:11 pm
by lieni
Hey, cool! I'm looking forward to see that in action!

I think I already got the solution for the shoot/disappear bug (I just can't tell it right now where it's exactly)

Keep going ;)

Posted: Wed Dec 06, 2006 8:42 am
by beni
That is really cool it works because that is a critical feature.
We will most certainly not give the player the possibility to shoot while fading, but you should fix that anyway.

My idea was earlier on, that the camera is a lot more detached from its target. This means you should program a few "modes" into which the camera can be put. I thought of following stuff:
  • follow target
  • follow target without moving
  • follow target, but move somewhere else
  • circle around target
  • switch target softly and instantly
  • free camera mode
Stuff like that. But don't get distracted by my ideas too much. I'm sure you have your own ideas and I don't want to make you change them.

Posted: Wed Dec 06, 2006 7:05 pm
by filbert
@beni: thx for the great ideas


while I was programming I realized that something has to be discussed:
In the camera.cc the camera is controlled by the glut function gluLookAt()

Code: Select all

void Camera::project()
{
  Vector cameraPosition = this->getAbsCoor();
  Vector targetPosition = this->target->getAbsCoor();



       // Setting the Camera Eye, lookAt and up Vectors
  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
            targetPosition.x, targetPosition.y, targetPosition.z,
            this->upVector.x, this->upVector.y, this->upVector.z);
}
You can see that the camera position is relative to the ship.
There are more possibilities to realize the camera cut scenes:
  • to write a new class (like scripCamera).
    Problem: how easy is it to switch between these classes? (with EventLayer?)
  • to fill in the arguments of gluLookAt() some parameters which are controlled by methods which iterate these parameters to the value given by the script.
    Problem: Too difficult, because camera position is influenced by the ship
  • to create a variable which tells, which camera mode should be used.
    in the Camera::project() method, there will be a condition which will choose to do the right thing
    :D
    I can't think of a problem here.

Posted: Wed Dec 06, 2006 9:03 pm
by beni
The trick of that whole thing is, as far as I know the camera target. Since the camera consists of the camera itself and the camera target, you can probably do something with the target.
As for now we had the target attached to the ship. We can of course detach the target from the ship easily and the camera would stop moving. I guess we can do a lot of stuff by manipulating the camera target (move it, detach and attach it, turn it). Think about it.

Posted: Wed Dec 06, 2006 11:27 pm
by bensch
to create a variable which tells, which camera mode should be used.
This breaks the independance of the Camera. Just be aware, that the Camera class should not really know that it is handled inside of orxonox, but rather in a 3D-scene, so making a condition inside of the Camera, means that the camera knows states, it should not know about.

The approach with with a Script-Driven camera seems much more elegant, and also it is the easiest to implement.

To guide the Camera you might also want to consider using the Vertical Scroller Implementation of the track, because in the track should also be able to define camera modes (possibly).

Posted: Thu Dec 07, 2006 6:17 pm
by filbert
thx bensch

but what i'm still interested in:
the Camera class should not really know that it is handled inside of orxonox
why?

Posted: Sat Dec 09, 2006 6:43 pm
by lieni
good question?! ;)

another thing, bensch once talked about getting rid of all the glu stuff, gluPerstpective could be removed by using http://steinsoft.net/index.php?site=Pro ... rspective/ , and for the gluLook at see http://wiki.delphigl.com/index.php/gluLookAt (using matrixmode viewport). but i think there is more important work for now.

Posted: Sun Dec 10, 2006 6:27 pm
by patrick
what are you currently working on?

Posted: Mon Dec 11, 2006 2:04 pm
by filbert
i'm writing the scriptable camera class :P

Posted: Wed Dec 13, 2006 12:15 am
by lieni
cool! i wonder how its working, would be great if you checked it in