unity - 1/20/2011 CAP 6121 – 3D User Interfaces for Games...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1/20/2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality Salman Cheema January 19 th , 2011 Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 1 Game Development Tool Download at www.unity3d.com Useful Features Imports 3D models easily* Terrain Modeling Tool Integrated Physics Engine (NVidia PhysX) Audio Networking Highly scriptable (C#, Boo and Javascript) Very easy to prototype games Free and Pro versions Pro version has more features, e.g. ability to play videos Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 2 1 1/20/2011 Unity OpenGL, DirectX, XNA High Level Low level Little programming Lots of Programming Components already Start from scratch available Highly visual Result isn’t immediately visible Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 3 Using the Editor Prefabs Scripting Setting up a simple game world First Person View Import 3D models Particles (fire effects, dust, snow) Collision Detection Triggers Interfacing the Kinect with Unity3D Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 4 2 1/20/2011 Scene View Positioning/manipulation of objects in the environment Inspector Alter properties of game objects Project Shows everything in current project Hierarchy Contains objects in currently loaded scene Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 5 Parenting Construct complicated objects by arranging components in hierarchical manner Prefabs Suppose you need a monster in your game Load a model for a monster Position point lights to light the model properly Attach some particle effects to make it menacing What if you want 10 such monsters? Solution: Create a monster template (prefab) and clone it Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 6 3 1/20/2011 Scenes Initial Menu, Game Levels, High Scores, … Game Objects Geometry, Particles, Camera(s), … Scripts Behavior for Player, Enemies, Collisions, … Other Resources Sounds, fonts, images, prefabs … Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 7 RigidBody Component Forces, velocity, … Collider Component Box Sphere Capsule Mesh Trigger Ignored by the physics engine Can be used to trigger game events, cut scenes, etc Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 8 4 1/20/2011 Change behavior of Game objects Only form of programming required in unity Most important aspect of a game Can be written in C#, JavaScript, or Boo Important functions Start Update FixedUpdate OnGUI OnCollisionEnter OnTriggerEnter Called when a script is instantiated Called once every frame Physics update Used to display GUI (score, health,…) Collision Detection Collision with a Trigger For all script functions, see MonoBehavior in unity script reference [http://unity3d.com/support/documentation/ScriptReference/MonoB ehaviour.html] Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 9 Mathematics Vector3, Quaternion, Mathf, Ray, … Audio Related AudioClip, audio, … Physics Related Rigidbody, Collider, Physics, … GUI Related Texture2D, GUI, … Others GameObject, Input, Application, … Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 10 5 1/20/2011 A script can be applied to multiple game objects Each game object gets own copy Public variables visible in Inspector modifiable at runtime Can drap and drop Be careful with parenting and tags Components referenced in script may be within children Make use of Debug.Log for debugging Be Cautious: Build incrementally Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 11 Models Google Sketchup warehouse Manual http://unity3d.com/support/documentation/Manual/index.html Script Reference http://unity3d.com/support/documentation/ScriptReference/index.html Unity Tutorial Videos http://unity3d.com/support/documentation/video/ Resources http://unity3d.com/support/resources/ http://www.unifycommunity.com/wiki/index.php?title=Main_Page Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 12 6 1/20/2011 http://groups.google.com/group/openni‐ dev/browse_thread/thread/e698f58c1b3b95f3/9f19fea1bea7490d?lnk=gst&q =installation#9f19fea1bea7490d Summary: 1. 2. Download and unzip Kinect drivers file "avin2‐SensorKinect‐b7cd39d.zip“ from https://github.com/avin2/SensorKinect Connect the Kinect to your PC, and install driver executable will be found under "avin2‐SensorKinect‐ b7cd39d\Platform\Win32\Driver“ 3. 4. 5. 6. Download "OpenNI 1.0 Alpha build 23 binaries for Win32" from http://www.openni.org and install Execute "SensorKinect‐Win32‐5.0.0.exe" from 'Bin' folder in package you unzipped in 1. Download "PrimeSense NITE version 1.3 Beta" from http://www.openni.org and install it For NITE, use the following key code 0KOIk2JeIBYClPWVnMoRKn5cdY4= Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 13 OpenNI sample project https://github.com/OpenNI/UnityWrapper C# wrapper around a DLL Key Components UnityInterface.dll OpenNI.xml Example Spring 2011 CAP 6121 – 3D User Interfaces for Games and Virtual Reality 14 7 ...
View Full Document

This note was uploaded on 08/25/2011 for the course CAP 6121 taught by Professor Lavoilajr. during the Spring '11 term at University of Central Florida.

Ask a homework question - tutors are online