WIG3004 virtual reality chapter3 software.pptx

GarethNg8 17 views 31 slides Aug 07, 2024
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

A chapter describes software in virtual reality


Slide Content

WIG 3004 VIRTUAL REALITY Software

W h at is software?

Communication 1 Hardware 2 Software 3 User

UNITY Game engine

Cross-platform: PC, mobile, web, console Both 2D and 3D Scripting in C# Free but with limits Monthly subscription (more features) https://unity.com/ https://learn.unity.com/ UNITY The Game Engine

Powerful Free Used by many industries: Automotive and Transportation Brand Ads Film Gaming Gambling Learning and Training AR and VR Why UNITY ?

Project: Access and manage the assets in the project Scene: Interactive view of the world . Select and position all the objects Game: Represents your final published product Inspector: detailed information about the currently selected object. Hi erarchy : List of all objects UNITY Windows

Project Window

Scene Window

Game Window

Inspector Window

Hierarchy Window

Every object in the game is a GameObject (important) Components can be added into it to give it properties UNITY Basic: GameObject

Determines position, rotation, and scale All GameObjects have a Transform component Cannot be removed UNITY Basic: Transform

Helps identify GameObjects for scripting purposes UNITY Basic: Tags

Static: Inform that the object will not move. UNITY Basic: Static

Store GameObjects along with its properties and components Create instances A change in a prefab affects all its instances. Instance settings can be overridden. UNITY Basic: Prefabs

Light Define the colour and mood of the 3D environment. Different kinds of lights: Directional Point Spotlight Area

Camera Display the game world to player. At least one camera in a scene. Can be set to either Perspective or Orthographic projection.

Scripting Essential in all games. Unity uses C# as the main scripting language. Uses: Response to input Trigger events Create graphical effects Control physical behavior Implement custom AI system And many more

Scripting: Syntax Basic Syntax (Grammar): Keywords – words with special meanings Comments – for documentation purposes Variables / Attributes – act as containers to values Functions / Methods – a group of reusable code performing a task Operators – for logical/arithmetic operations Predefined values – values hardcoded into the script String – words that will appear as is when executed. *Syntax is case-sensitive. Meaning “ abc ” is NOT equal to “ABC”.

Scripting: Data Type Primitive data type: Defined by the programming language. Programmer-defined data type: Defined by the programmer Defined by tool such as Unity

Scripting: Variables A name given to a storage area used to store values of various data types. Syntax: data-type variable-name ; data-type variable-name = data-value ; data-type variable-name1, variable-name2 ; Example: int num = 1 ; There are rules when naming a variable: Cannot begin with numbers or special characters: int 1num ; Cannot use keywords: int int ; Cannot have empty spaces: int num one ;

Scripting: Array A collection or series of the same data type. The content of an array are called its elements. Array elements always begin with 0; Syntax: data-type [] array-name ; Example: int [] nums ;

Scripting: Class Encapsulation of data properties and data methods. Properties: describe the data the class will be holding. Methods: what operations can be performed on the data.

Scripting: Decision making Decision-making if, if…else, nested if switch Conditional operator: “? :”

Scripting: Loop Looping While, do…while For, foreach

Animation Simulation What else UNITY can do?

Draw their relation Hardware * SOFTWARE * user