Angry Teapots– using the physics engine in Unity Peter Passmore.

Slides:



Advertisements
Similar presentations
Where to get Blender for Free! Download from Blender.org and run the installer.
Advertisements

KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Blender: Introduction, Modelling and Exporting 4076/GV07: Virtual Environments (VE) MSci 4th year, MSc VIVE, EngD Will Steptoe Room 6.22, Computer Science.
First things first – open SketchUp. You may be asked to choose a ‘Template’ For everyday use, choose the Simple Template – Meters Do not choose the Template.
FINAL CUT PRO VIDEO EDITING SUITE REVIEW. FINAL CUT PRO REVIEW GETTING STARTED: Start by clicking the Final Cut Pro (FCP) icon in your dock. Wait for.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
PART 1 – Layout of the Workspace. Why Photoshop? Information includes not only text and numbers, but images as well. The expression "a picture is worth.
GameCamp! and Game Davis Introduction to Unity®
GameCamp! and Game Davis Creating a 2D Platformer in Unity.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Based on Roll-a-ball video tutorial from Unity Technologies Part WakeUpAndCode.com.
Google SketchUp Castle
Unity 3D game IDE 1.  Unity is a multi-platform, integrated IDE for scripting games, and working with 3D virtual worlds  Including:  Game engine ▪
Master Project Preparation Murtaza Hussain. Unity (also called Unity3D) is a cross-platform game engine with a built-in IDE developed by Unity Technologies.
SE 320 – Introduction to Game Development Lecture 11: Animations and GoKit Lecturer: Gazihan Alankuş Please look at the last slides for assignments (marked.
Working in 3D using digital elevation models An example using ArcScene to investigate ice elevation and bed elevation data in Antarctic.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Adobe Flash Professional CS5 Provides a comprehensive authoring environment for creating digital animation and interactive Web sites. Used to create engaging.
To download PhotoStory: Go to On the left side under Product Resources, click on Downloads.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
File Upload Competitive Analysis. Catalyst - Browse in-line Of interest:
Main Navigation  Similar to Unity 3D  Unlike Unity it is a right handed coordinate system  Used to determines whether a positive rotation is clockwise.
TUTORIAL. Windows Movie Maker Tools  Tasks pane  Menu bar  Contents pane  Storyboard/ Timeline  Preview monitor.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
Web Games Programming An Introduction to Unity 3D.
UFCFS D Technologies for the Web Unity 3D: Review of Topics and Related Concepts.
Unity 5 Visual Studio Code * Asset Store * FPS * Terrain.
1. Press the New Layer Button 3. Double click names to re-name Ball & Shadow layers 2. Click to change to 12 fps Step 1.
Learning Unity. Getting Unity
SE 320 – Introduction to Game Development Lecture 3: Unity’s Interface and Concepts Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
UFCFS D Technologies for the Web Unity Interface Features.
Yingcai Xiao Game Development with Unity3D. Outline IDE Engine Assets Tutorial Examples Inside.
Yingcai Xiao Game Development Intro to Unreal Engine.
UFCEK-20-3Web Games Programming Unity 3D: Review of Topics Publishing for the Web.
Build-It-Yourself.com BLENDER 3D LESSON 3 BLENDER 3D LESSON 3.
Unity3D Physics April 3, 2015 Comp Game Design Michael Shah.
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Expressive Intelligence Studio // Center for Games and Playable Media // Unity Pro John Murray Expressive.
Cosc 5/4735 Unity 3D Getting Started Guide for Android.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 29 Soft Bodies and Rigid Bodies.
INTRO TO UNITY Building your first 3D game. DISCLAIMER  “This website is not affiliated with, maintained, endorsed or sponsored by Unity Technologies.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Game Development with Unity3D
Welcome! Day1, Lesson 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
Quick Intro to Unity Lecture 2.
Game Development with Unity3D Inside/Outside Unity3D
3D Modeling & Animation Software
3GB3 Game Design Unity 3D Basics.
MSC.visualNastran 4D Exercise Workbook
EEC-693/793 Applied Computer Vision with Depth Cameras
Learning the Basics – Lesson 1
Computer Animation Ying Zhu Georgia State University
Introducing Blender.
The Alice Interface.
Game Development Unity3D.
Introducing Blender.
EEC-693/793 Applied Computer Vision with Depth Cameras
Introducing Blender.
Animation Workshop Week 2
A Prime Example of HCI Application
Fusion 360 Pac Man Tutorial
Creating & Using Sprites Adding Colliders
A beginner’s tutorial for Unity and VR
Unity Terrain Design Tutorial
EEC-693/793 Applied Computer Vision with Depth Cameras
Presentation transcript:

Angry Teapots– using the physics engine in Unity Peter Passmore

What is Unity and what can I do with it? Unity is a fully integrated development engine that provides rich out-of-the-box functionality to create games and other interactive 3D content. You use Unity to assemble your art and assets into scenes and environments; add physics; simultaneously play test and edit your game, and when ready, publish to your chosen platforms, such as desktop computers, the Web, iOS, Android, Wii, PS3 and Xbox 360. Unity’s complete toolset, intuitive workspace and rapid, productive workflows help users to drastically reduce the time, effort and cost of making games.

Play some unity demos

Angry birds With a combined 1.7 billion downloads across all platforms and including both regular and special editions

Temple Run Temple Run 2 - Temple Run 2 Fastest Downloaded Mobile Game Ever, 50 Million Copies in Two Weeks (Thursday January 31, 2013) The previous fastest downloaded game was Angry Birds Space, selling 50 million copies in under six weeks bB3ZM bB3ZM

Critical Incident management training System using an Interactive Simulation environment PI: Prof William Wong, led by Middlesex University with 12 partners across 7 countries with ~€3.5M EU funding

Crisis

What do you need to make a 3D game?

3D objects – Geometry – Textures – Animation – Physics – Collision detection Lights Camera

Unity concepts Assets Scenes Game objects Components Scripts Prefabs

Unity Interface (windows|layouts|2 by 3)

Unity interface Scene – where game is constructed (set) Hierarchy – list of GameObjects used in the scene Inspector – settings for the currently selected asset/object e.g. its position scale Game – the preview window, where you actually play the game Project – a list of your assets (images, sounds etc)

The scene window The Hand tool – Pans the scene window. – If you hold down ALT it rotates the scene – If you hold down CTRL it zooms the scene The Translate tool – you can move you currently selected object along each of its axes The Rotate tool – rotate your object around each of the 3 axes The Scale tool - scale your object along each of the 3 axes – Drag on the central box to scale uniformly

Create two cubes Choose GameObject|Create Other|Cube to create a cube and set its postion and rotation as shown Choose GameObject|Create Other|Cube to create another cube, move it down Scale it to make a floor plane, name it Floor

Apply physics to the box Select cube Choose Components|Physics|RigidBody (note that gravity ticked in Inspector) Play animation (box falls and collides) Choose Assets|Import Package|Physic Materials click on All in the popup window Then select box1, in the Inspector under Box Collider click on small circle to the right next to Material – then Choose Bouncy When you play the game now the box bounces a lot

Note Bouncy in Box collider in the Inspector

Create a sphere Choose GameObject|Create Other|Sphere to create a sphere Make it a Rigid Body and Bouncy like the box Set its position manually by clicking on the sphere and typing in to the inspector setting its position

Light Choose GameObject|Create Other|Directional light Set its rotation as you like Move the view in the scene window until you can see everything well Select the Main Camera in the Hierarchy and choose GameObject|Align With View to use the same view for the game

Set shadows Select the Directional light and in the inspector turn on shadows by setting Shadow Type to Soft Shadows

E.g. I had this for Main Camera Transform With this scene view: See scene 1

Add colour (optional) Choose Assets|Create|Material A new material appears in the asset tab. Rename it by typing red Then in the Inspector window click on the white box next to main color, and a color picker box will appear, click on red

Add color (optional) Now drag the red material from the Assets tab and drop it on the sphere in the main window, the sphere now shows red Make two other colours for the floor and cube

Add texture – Basket ball Choose Assets|Import New Asset and navigate to basketBallTexture.jpg (in the assets folder) In the project window you will see the new texture as a Material Drag and drop this material onto the sphere to turn it into a basket ball

Add texture – cube and floor Now do the same for the cube using the texture called redPlasic.jpg Now do the same for the floor using the texture “Grass 02 seemless” In the inspector window set the tiling values for X and Y to 10 to get the texture down to a reasonable size.

Textured scene See scene3

Reset cube and sphere Transforms and view Reset cube transform to: Res t sphere transform to Change the view to so you can see the sphere and cube:

Write a script Right Click below the word Assets in the assets window and click on Create on the popup menu and then on Javascript A new document icon appears called New Behaviour, just type push and the document is now titles push Double click to edit the script After some time a window appears called mono editor

Edit the script so that it looks as follows:

Apply the script to the Sphere Save the script by choosing File|Save Now drag the push icon from the Assets window and drop it on the Sphere in the Hierarchy window The word sphere in the Hierarchy window will briefly show and blue line around Now if you click on the Sphere you will see that the script is attached to it at the bottom of the Inspector window

Script Click on the sphere and in the inspector window in crease the vale of powerZ until the ball hits the cube (e.g. 850) See Scene4

Collision! Now when you run Unity you will see that the – force is immediately applied to the sphere – and that it collides with the box and – both the box and the sphere behave like physical objects according to Newtons laws of motion. Click on the sphere in the Hierarchy window and then change the value of Powerz in the push Script section of the Inspector window to Explain what happens when you run the program.

Get a teapot In this case I import teapot from a 3D modelling package call 3D studio MAX You can find many 3d models on the net ALL you do is choose Assets|Import New Asset Then you new asset will appear in the assets tab And you can drag and drop it into the scene

Make the teapot angry!

Put the teapot in the scene Choose Assets|Import New Asset to import a the teapot into the scene. Set its transform to place it on the cube: Select the sphere and in the inspector set the value of PowerZ to 900 so the ball hits the teapot See scene 5

Add Skybox Choose Assets|ImportPackage|Skyboxes then click import in the popup window Choose Edit |Render Settings Next to Skybox Material in the Inspector tab on the right there is a small circle with a dot in the middle. Click this and it brings up the Select Material window. Choose Sunny 1 you now have a semi cloudy sky

Ball and teapot collide See scene 6

Step up time - optional Choose Edit|Project Settings |Time and change Time Scale eg from 1 to e.g. 4 You may have to change the values of forces after this (eg in the push script)

Make two mesh collider objects collide Select the teapot in the Hierarchy window Right click and chose duplicate and a copy is made in the exact same position as the existing one. Move it up to see it. If you run the program the two teapot pass through each other To fix this problem tick the Convex flag in the mesh collider section of either teapot (this is supposed to only work for object of 256 or less polygons)

All these steps are in the tutorial project on your computer Now build your own game/simulation!