Camera support for Cut-Scenes

Introduce your project and write about your work.

Moderator: PPS-Leaders

Post Reply
filbert
Noxonian Grollknom
Posts: 5
Joined: Wed Nov 01, 2006 2:22 pm

Camera support for Cut-Scenes

Post by filbert » Tue Nov 21, 2006 10:15 pm


filbert
Noxonian Grollknom
Posts: 5
Joined: Wed Nov 01, 2006 2:22 pm

current state

Post by filbert » Tue Dec 05, 2006 6:07 pm

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.

User avatar
lieni
Noxonian Reg'metholt
Posts: 56
Joined: Tue Oct 31, 2006 4:35 pm
Location: Hell
Contact:

Post by lieni » Tue Dec 05, 2006 7:11 pm

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 ;)
The secret to creativity is knowing how to hide your sources.

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Wed Dec 06, 2006 8:42 am

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.
"I'm Commander Shepard and this is my favorite forum on the internet."

filbert
Noxonian Grollknom
Posts: 5
Joined: Wed Nov 01, 2006 2:22 pm

Post by filbert » Wed Dec 06, 2006 7:05 pm

@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.

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Wed Dec 06, 2006 9:03 pm

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.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
bensch
Admiral Alexi Sarkhov
Posts: 101
Joined: Tue Oct 03, 2006 2:28 pm
Contact:

Post by bensch » Wed Dec 06, 2006 11:27 pm

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).

filbert
Noxonian Grollknom
Posts: 5
Joined: Wed Nov 01, 2006 2:22 pm

Post by filbert » Thu Dec 07, 2006 6:17 pm

thx bensch

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

User avatar
lieni
Noxonian Reg'metholt
Posts: 56
Joined: Tue Oct 31, 2006 4:35 pm
Location: Hell
Contact:

Post by lieni » Sat Dec 09, 2006 6:43 pm

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.
The secret to creativity is knowing how to hide your sources.

User avatar
patrick
Baron Vladimir Harkonnen
Posts: 350
Joined: Mon Oct 02, 2006 6:03 pm
Location: Bern

Post by patrick » Sun Dec 10, 2006 6:27 pm

what are you currently working on?

filbert
Noxonian Grollknom
Posts: 5
Joined: Wed Nov 01, 2006 2:22 pm

Post by filbert » Mon Dec 11, 2006 2:04 pm

i'm writing the scriptable camera class :P

User avatar
lieni
Noxonian Reg'metholt
Posts: 56
Joined: Tue Oct 31, 2006 4:35 pm
Location: Hell
Contact:

Post by lieni » Wed Dec 13, 2006 12:15 am

cool! i wonder how its working, would be great if you checked it in
The secret to creativity is knowing how to hide your sources.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest