ODE / Creature Contest Help Session Winter 2009. Outline ODE and GLUT libraries How the skeleton code works – If you were going to adapt any skeleton.

Slides:



Advertisements
Similar presentations
Asteroids Games and Simulations O-O Programming in Java The Walker School The Walker School – Games and Simulations
Advertisements

A Momentum-based Bipedal Balance Controller Yuting Ye May 10, 2006.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
1Notes  Assignment 2 is out  Flocking references  Reynolds, “Flocks, Herds, and Schools…”, SIGGRAPH’87  Tu and Terzopoulos, “Artificial Fishes…”, SIGGRAPH’94.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
1 7M836 Animation & Rendering Animation Jakob Beetz Joran Jessurun
T.J. Hartnett CSE 704 Seminar Dr. Miller Spring ‘11 EVOLVING CREATURES.
1cs426-winter-2008 Notes  Please read: C. Reynolds “Flocks, Herds, and Schools…” SIGGRAPH ‘87
Based on slides created by Edward Angel
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
2D Physics and Camera Systems For CSE 3902 By: Matt Boggus.
Introduction to virtual engineering László Horváth Budapest Tech John von Neumann Faculty of Informatics Institute of Intelligent Engineering.
1 7M836 Animation & Rendering Animation Jakob Beetz Joran Jessurun
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
1 TouchDevelop Chapter 8-10 Presenter: Jing Xu. 2 Outline Interactions Game Board Tiles and Printing.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
DYNAMICS Part I Physics Engine By Willis (The Magnificent) Louie Fei (The Coyote) Liao.
Introduction to TouchDevelop
Advanced Programming for 3D Applications CE Bob Hobbs Staffordshire university Human Motion Lecture 3.
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
Game Engine Programming. Game Engine Game Engine Rendering Engine (OGRE) Rendering Engine (OGRE) Physics Engine (Bullet) Physics Engine (Bullet) Input/Output.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
Computer Graphics I, Fall 2010 Input and Interaction.
CS 450: COMPUTER GRAPHICS PORTRAIT OF AN OPENGL PROGRAM SPRING 2015 DR. MICHAEL J. REALE.
Animator Help Session. Agenda Introduction Curve implementation - Requirements - What are all those vectors? - Where should I put things? Particle System.
CS 480/680 Computer Graphics Programming with Open GL Part 7: Input and Interaction Dr. Frederick C Harris, Jr. Fall 2011.
Evolving Virtual Creatures & Evolving 3D Morphology and Behavior by Competition Papers by Karl Sims Presented by Sarah Waziruddin.
Animation Basics. A) Animation In animation we attempt to make things that aren’t really there appear as though they could actually exist and move in.
Learning Unity. Getting Unity
Project 1: Animation System Assigned: 01/17/06 Due: 01/31/06.
Game Maker Terminology
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Game Maker – Getting Started What is Game Maker?.
Lecture 3 Intro to Posture Control Working with Dynamic Models.
1 Input and Interaction. 2 Objectives Introduce the basic input devices ­Physical Devices ­Logical Devices ­Input Modes Event-driven input Introduce double.
More on GLUT Programming Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, September 15, 2003.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Computer Game Design and Development
Vizard Virtual Reality Toolkits Vizard Virtual Reality Toolkits.
University of New Mexico
Game Programming Patterns Game Loop From the book by Robert Nystrom
(c) University of Washington02-1 CSC 143 Java Object and Class Relationships: Interfaces Reading: Ch. 9 (on Java interfaces)
DYNAMICS Part 2 HOW DOES IT WORK?? by Willis Louie Jianfei Liao.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Framsticks physics © Szymon Ulatowski. Simulation goals Physics-based: create real-world feeling to intuitively understand behaviors Not necessarily very.
“RINGS” PES Institute of Technology and Management Presented by Under the Guidance of Mr. ABHISHEK S A 4PM12CS002 Mr. ASHWIN K KASHYAP 4PM12CS015 Mr. DEVARAJ.
Problem 3 ME 115 Final – Troy Topping. Initial Construction A box with m = 1250 kg is input to simulate the forklift Only half the mass is used since.
Rigid Body Dynamics: A Graphical Simulation Eugene Paik
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 29 Soft Bodies and Rigid Bodies.
Simulation of Characters in Entertainment Virtual Reality.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Game Development with Unity3D
Advanced Computer Graphics Rigid Body Simulation
Interactive Animation
Creating a UFO Rescue Game in Alice
Computer Animation Ying Zhu Georgia State University
Lecture Rigid Body Dynamics.
Creating a UFO Rescue Game in Alice
Week 6: Time and triggers!
Tonga Institute of Higher Education IT 141: Information Systems
Advanced Games Development Game Physics
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

ODE / Creature Contest Help Session Winter 2009

Outline ODE and GLUT libraries How the skeleton code works – If you were going to adapt any skeleton code for any graphics applications in the future… you could probably start with this instead of the other hairy assignments from this class ODE basics Project requirements

Open Dynamics Engine (ODE) Library for simulating articulated rigid body dynamics Fast, robust, built-in collision detection Articulated structure = rigid bodies of various shapes connected together with various kinds of joints

OpenGL Utility Toolkit (GLUT) ut/ ut/ Library for writing OpenGL programs – Makes it easy to write an application that opens a window and displays stuff Callback driven event processing Handle events from input devices: mouse, keyboard, etc. Kind of like FLTK, minus GUI

Program Flow Both GLUT and ODE work like this: – Set up some stuff, start main loop (handle events, draw/simulate, repeat) Initialize Handle Events Tick physics/redraw graphics/whatev er User clicked ‘quit’

Creature Contest Program Flow Initialize Handle Events Tick physics User quits Control/change joint forces/‘think’ Redraw

Nitty gritty application details The graphics loop is the main loop After starting glutMainLoop(), no longer have direct control Need a physics simulation loop, too glutIdleFunc called when not drawing anything – Update physics here (dWorldStep()) – Force redraw glutDisplayFunc called to redraw

Class: CreatureWorld Sets up graphics, physics, everything else Contains: – Main() – 1 Creature object – 1 Terrain object Init graphics: GLUT window, mouse and keyboard callbacks Init physics: create ODE simulation environment, set gravity to (0,0,-9.9), populate according to terrain and creature build() functions Init control: Start creature thought process

CreatureWorld (cont.) Each ‘tick’ – Tick control: creature.think(), up to you to implement – Tick physics: dWorldStep() – Redraw: glutPostRedisplay() Drawing function – Camera controls (camera happens to follow a user- specified position on creature, you can change this) – Terrain responsible for drawing itself: terrain.draw() – Creature responsible for drawing itself: creature.draw()

Class: Terrain Ground Obstacles/ramps on ground Height map Build(): define the terrain, put it in physics simulation Draw(): describe how to draw it, can include colors and textures

Class: Creature Articulated rigid-body structure held together with joints Also contains some ‘brains’ for deciding how to move and control joints YOU have to build it, draw it, and make a controller for it: – build(), draw(), start_thinking(), think()

ODE Basics Read the manual: /Manual /Manual

Some Terms World: ‘a dynamics world’ – Think masses, forces, movement Space: ‘a collision space’ – Think 3d shapes colliding, intersecting – Collisions generate forces which have an effect on the world Body: a rigid body living in the world Geom: geometry (for collision), need a geom to spatially describe a body if you want it to collide with anything Joint: a constraint between two bodies

Rigid Body A body has – Position (of its center of mass) – Mass, inertia matrix describing distribution of mass – Orientation – Linear velocity – Angular velocity – NO PHYSICAL SHAPE! Unless you also define a geom – Lives in the WORLD! Moves, has forces applied to it, may be connected to other bodies with joints

Geom A geom has – Shape (box, cylinder, etc) – Possibly a body associated with it – Lives in the SPACE! Each limb of your creature will be a body plus a geom – Define a geom in the same shape and position as the body’s mass (see code for example) – Once attached to a body, a geom will have same position/orientation

Geom (cont.) In starter code: – geoms are all box shaped – put in a vector of geoms for drawing and manipulating – draw function loops over each boxy geom, gets position and scale factor, draws it, and draws its shadow If you have differently shaped geoms, you should handle keep track of them and draw them differently Creature class includes function to turn geom/body position into transformation matrix for easy drawing

Joint Connects two bodies Lives in the WORLD Lots of kinds… Hinge joint Universal Hinge 2 Ball and Socket

Controlling Joints Read the manual, experiment, look at examples… I’m learning this along with you Motors – specify a velocity and the maximum force you want to use to achieve this velocity Stops – Prevent joints from moving along whole range of motion (eg. Your knee doesn’t bend backwards) – Limit forces when using motors Motion parameters (dParamVel, dParamLoStop, dParamFMax are a few) Set force/torque directly

Collision Detection Already set up for you (look at cb_near for more details) Internal check to see which objects in the space are colliding – create contact points at each collision – create a joint (between bodies) at each contact point – force colliding bodies away from each other – destroy contact joints before next time step

General things you might end up tweaking Read the manual for different ways to tune your simulation dWorldStep vs dWorldQuickStep – QuickStep useful when your simulation has >100s of objects… less accurate and stable – Should probably use constant physics time step but starter code tries to keep constant animation rate… tweak this if your simulations have stability problems Error Reduction Parameter (erp) Constraint Force Mixing (cfm) Friction… maybe skeleton code doesn’t have it

Putting it together Now you know the basics to give your creature joints and limbs! Gravity and collision simulations will happen automatically You need to define how the creature moves No animation key frames here, have to do it all in code…

Actual Project Requirements Make a creature that walks from one zone, across the playing field, to the finish zone. – Start: x<0 – Finish: x>100? (variable course width, to be determined, tell to creature at start up) start finish x y z (up)

Vague… grading… criteria… I’m not sure how to invent new assignments Have fun!! Do something cool! – Hopefully the time and effort you put into it will be apparent Get a creature that can stumble across a flat terrain Make a new terrain (ahh, you don’t have to put these shapes into the World, just into the Space) Describe your design and controller in a short but intelligent- sounding webpage write-up, include some graphics and/or animations Bonus points for dressing up your creature with faces/colors/textures/etc. (as long as it also can get from start to finish) I should make an actual webpage for this project and post this information there

Constraints Minimum torso size: 1x1x1 Maximum torso size: 10x10x10 Minimum density: not sure yet Minimum leg length/width ratio: not sure yet, can’t have infinitely thin legs Maximum torque and velocity: not sure yet These are to keep you from ‘cheating’, but the creative ways you could cheat might be interesting

Basically… I could pick random numbers, but maybe that’s not the point Just make something that walks, hops, or slithers and doesn’t really cheat “How do I know if I’m cheating?” – Does it touch the ground a few times between start and finish area Speed, style, creativity will be judged subjectively by the class…

Check out these blocky creatures Karl Sims – Evolved Virtual Creatures (SIGGRAPH 1994) – creatures.html creatures.html