Download presentation
Presentation is loading. Please wait.
Published byLaurel Potter Modified over 9 years ago
1
(Interactive) Cinematography Ref: Chap. 16 (Core Techniques and Algorithms in Game Programming)
2
Introduction Placing the camera is extremely important from a narrative standpoint Helps to convey the story [interesting games spoiled by bad camera angles]
3
FPS Camera movement: 4 DOF (x,y,z,yaw) Pitch (sometimes); strafing (moving sideways) E.g., keyboard (playerpos) + mouse (orientation) Adding inertia to camera for increased realism implement control on acceleration (not velocity) [opengl implementation]
4
FPS Control forward back strafe Use mouse to change direction
5
Implementing FPS Right: x+=rcos z-= rsin Left: x-=rcos z+= rsin Up: x -= rsin z-=rcos Down:x+= rsin z+=rcos playerpos X -Z
6
Inertia Camera Keyboard: still position control Mouse drag: Speed proportional to torque Each jerk represent an impulsive torque Need friction to stop Time-based motion by Euler integration
7
Mouse Movement Use glutPassiveMotionFunc Detect moving direction Detect moving speed Related API calls: glutPassiveMotionFunc, glutSetCursor, glutWarpPointer Ref: Ref:http://www.gamedev.net/community/forums/topic.asp?topic_id=202516 Issues: 1.Hide mouse cursor 2.Lock mouse focus
8
Flight Simulation Placing virtual camera inside a cockpit Complexity: 6 DOF Careful for upside-down motion (flying a loop) Euler angles: gimbal lock problem Use quaternion [how? Code]
9
Third-person Camera Not to occlude the enemy Problem: rotating will cause the camera to define large arcs (motion sickness) Solution: inertia camera Interpolate orientation: quaternion Problem: camera colliding with level geometry Solution: transparent wall between Change camera location: move up (lower roof), sideways (corner), in front of the player
10
Third Person Camera Camera position Camera lookat Player position Fwd distance
11
Cinematic Cameras
12
Camera Styles Fixed camera Dolly cameras Crane cameras Steadycams Implement a real-time algorithm that selects the best camera according to heuristics (e.g., the one closest to player)
13
Placement Algorithms Basic rules: show everything relevant to the scene Should be placed so obstruction between relevant information does not occur Aimed at a point of interest Main character, other character in the vicinity, pickable items closer than a threshold, objects relevant to game play (e.g., obstacle)
14
Ex: Camera Placement Fixed Pan Dolly Pan Dolly
15
Agent-based Approach AI techniques (rule-based system) to model the decision process used by our virtual cinematographer in order to call the best possible shot
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.