Simple 3D Camera Game Design Experience Professor Jim Whitehead March 6, 2009 Creative Commons Attribution 3.0 (Except copyrighted images) creativecommons.org/licenses/by/3.0.

Slides:



Advertisements
Similar presentations
Defining the Viewing Coordinate System
Advertisements

Macromedia Fireworks MX 2004 – Design Professional Importing, Selecting, and Modifying Graphics.
Lighting and Procedural Textures. Purpose In this chapter, you will learn about the following:  Setting up a camera and lights to really show off your.
Texture Components and Euler Angles: part 1 June 2007
Three Dimensional Modeling Transformations
Kinematic Modelling in Robotics
Bad code smells Refactoring Example Game Design Experience Professor Jim Whitehead January 26, 2009 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Forward and Inverse Kinematics CSE 3541 Matt Boggus.
The Firing Solution IMGD 4000 Due: optional, but no later than May 5 th, 11:59pm Note! No “late” submission allowed for this project.
Horizontal Scrolling through Tileset Levels Game Design Experience Professor Jim Whitehead March 4, 2008 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Procedural vs Object Oriented Design Bad code smells Game Design Experience Professor Jim Whitehead January 23, 2009 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Introduction to Shader Programming
Point Lighting Using Shaders Game Design Experience Professor Jim Whitehead March 13, 2009 Creative Commons Attribution 3.0 (Except copyrighted images.
Particle Systems Final Exam Study Guide Game Design Experience Professor Jim Whitehead March 16, 2009 Creative Commons Attribution 3.0 (Except copyrighted.
3-D Geometry.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera.
Introduction to 3D in XNA Game Design Experience Professor Jim Whitehead February 27, 2009 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Triangles, Translations Game Design Experience Professor Jim Whitehead March 2, 2009 Creative Commons Attribution 3.0 (Except copyrighted images) creativecommons.org/licenses/by/3.0.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Exam Questions Chain of Responsibility & Singleton Patterns Game Design Experience Professor Jim Whitehead February 4, 2009 Creative Commons Attribution.
Screw Rotation and Other Rotational Forms
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
UNIT - 5 3D transformation and viewing. 3D Point  We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented.
Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 3.1: 3D Geometry Jürgen Sturm Technische Universität München.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
Announcements: Assignment for Monday: read chapter 4 of text
Introduction to 3D Computer Graphics and Virtual Reality McConnell text.
Vectors Jeff Chastine.
Game Physics – Part IV Moving to 3D
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Wednesday CS361.
Geometric Transforms Changing coordinate systems.
1 Useful Tools for Making Video Games Part V An overview of.
POSITION & ORIENTATION ANALYSIS. This lecture continues the discussion on a body that cannot be treated as a single particle but as a combination of a.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Announcements Prototype submissions will be directly from SVN on Gforge.
Shadows via Projection Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, November 5, 2003.
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
Digital Image Processing: Bernd Girod, © Stanford University -- Project Hints 1 EE368/CS232 poster session Poster session March 12, 4-6 p.m.,
The Camera Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended Reading.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Aerodynamic forces on the blade, COP, Optimum blade profiles
Arizona’s First University. Command and Control Wind Tunnel Simulated Camera Design Jacob Gulotta.
3D Cameras and Enemies COSC 315 Fall 2014 Bridget M. Blodgett.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
End effector End effector - the last coordinate system of figure Located in joint N. But usually, we want to specify it in base coordinates. 1.
Discrete Math Section 12.9 Define and apply the cross product The cross product of two vectors results in another vector. If v 1 = and v 2 =, the cross.
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
TA: Ryan Freedman Sushma Kini Chi Zhou.  Due Date: March , 12:30 PM  We want a zip folder named cs418_mp1_{netid}.zip which contains  Source.
By Bala M. Dhareneni.  A pitch motion is an up or down movement of the nose of the aircraft  The pitch axis is perpendicular to the aircraft centerline.
Robotics Chapter 3 – Forward Kinematics
What you will learn about today
Character Animation Forward and Inverse Kinematics
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
3D Part3 CMT3317.
Lift Production LOW PRESSURE HIGH PRESSURE Level Three OHP # 1.
CSC461: Lecture 19 Computer Viewing
A Photograph of two papers
Computer Graphics Imaging
What you will learn about today
UMBC Graphics for Games
Viewing (Projections)
CSCE441: Computer Graphics 2D/3D Transformations
Game Programming Algorithms and Techniques
Screw Rotation and Other Rotational Forms
CS 352: Computer Graphics Chapter 5: Viewing.
Presentation transcript:

Simple 3D Camera Game Design Experience Professor Jim Whitehead March 6, 2009 Creative Commons Attribution 3.0 (Except copyrighted images) creativecommons.org/licenses/by/3.0

Announcements Days until Final Project Due: 10 ► Due Monday, March 16 ► Few students have been attending help sessions ► We will not be able to help you as well at the last minute 3D modeling homework ► Assignment text now on web ► Due Monday, March 9 ► Assignment will involve: Create a simple 3D model (e.g., in Blender) –Something slightly (but not by much) more complex than a cube will be fine Make this model show up in XNA Extra credit for making model rotate, applying bitmap textures Goal is to exercise a model import pathway ► Intended to be a straightforward assignment ► Submit code via Homework submission website

3D Camera In many 3D games, when the player moves, this results in the camera being moved The camera is the player’s view into the game world Existing 3D code shown in class has not moved the camera ► Now we will!

Camera Refresh Camera is comprised of two Matrix objects ► View matrix holds information on Location of camera in world Camera direction Camera orientation Modify view to move camera ► Projection matrix holds information on View angle Aspect ratio Near and far plane Typically stays constant Location (x,y,z) Orientation Direction

Make Direction Explicit In past, have created view matrix as follows: ► View = Matrix.CreateLookAt(pos, target, up) ► Creates view from camera position, and explicit point target of the camera For camera manipulations, is more convenient to compute Direction vector (vector math) ► Direction = target – pos Typically then normalize ► Make all values between 0 and 1 To create view using Direction ► View = Matrix.CreateLookAt(pos, pos+Direction, up) Position (x,y,z) Orientation Direction Camera target Camera position Camera direction Target

Moving Camera Forward/Back Moving a camera involves changing its position ► Typically add a fixed increment (speed) to position each clock tick ► But, want to move the way the camera is facing ► That is, want to move in the direction of the Direction vector cameraPosition += cameraDirection * speed; ► Moves forward/backwards Position (x,y,z) Direction

Moving Camera Side to Side To move side-to-side, need vector that is simultaneously perpendicular to Direction and Up vectors ► A Matrix cross product computes this ► Once this sideways vector is computed, add a small amount each clock tick to position to move that way ► cameraPosition += Vector3.Cross( cameraUp, cameraDirection) * speed; Position (x,y,z) Direction Up Up x Direction

Rotating the Camera To rotate the camera, need to rotate around the three axial vectors of the camera ► Yaw – rotate around Up ► Roll – rotate around Direction ► Pitch – rotate around Up x Direction General approach ► Use Vector3.Transform method ► First parameter is axis to rotate around ► Second parameter is call to Matrix.CreateFromAxisAngle

Rotations Yaw ► Change Direction vector by rotating around Up ► cameraDirection = Vector3.Transform (cameraDirection, Matrix. CreateFromAxisAngle(cameraUp, angle) Roll ► Change Up vector by rotating around Direction ► cameraUp = Vector3.Transform(cameraUp, Matrix.CreateFromAxisAngle(cameraDirection, angle) Pitch ► Change Up and Direction vectors by rotating around Up x Direction ► cameraDirection = Vector3.Transform(cameraDirection, Matrix.CreateFromAxisAngle( Vector3.Cross(cameraUp, cameraDirection), angle)); ► cameraUp = Vector3.Transform(cameraUp, Matrix.CreateFromAxisAngle( Vector3.Cross(cameraUp, cameraDirection), angle)); Position (x,y,z) Direction Up x Direction Up

Source Code Example Examine source code from Chapter 11 of Learning XNA 3.0 ► Note: code was modified to use I-K and J-L for rotations, instead of mouse