Simulation Engines TDA571|DIT030 Multimedia and scenegraphs
Tommaso Piazza
1
Simulation Engines TDA571|DIT030 Multimedia and scenegraphs - - PowerPoint PPT Presentation
Simulation Engines TDA571|DIT030 Multimedia and scenegraphs Tommaso Piazza 1 Administrative stuff Student Representatives People with orange or red extension IDC | Interaction Design Collegium 2 Introduction Multimedia is
1
IDC | Interaction Design Collegium
2
IDC | Interaction Design Collegium
3
IDC | Interaction Design Collegium
4
IDC | Interaction Design Collegium
5
IDC | Interaction Design Collegium
6
IDC | Interaction Design Collegium
7
IDC | Interaction Design Collegium
properties of the surrounding area)
velocity and direction
the player receiving the sound
shape and other physical attributes. Often tied to the listener
8
IDC | Interaction Design Collegium
9
IDC | Interaction Design Collegium
voices and up to 4 effects on each voice
concurrent environments that affect sound differently
10
IDC | Interaction Design Collegium
11
IDC | Interaction Design Collegium
12
IDC | Interaction Design Collegium
containing sound data. Also contains information about position and velocity.
velocity.
Controlled by sources and are never manipulated directly. In many cases they are transferred to the sound card prior to playback and are thus immutable.
13
IDC | Interaction Design Collegium
14
IDC | Interaction Design Collegium
15
IDC | Interaction Design Collegium
16
IDC | Interaction Design Collegium
17
IDC | Interaction Design Collegium
18
IDC | Interaction Design Collegium
19
IDC | Interaction Design Collegium
20
IDC | Interaction Design Collegium
are masked. Example: A bird singing next to a running car is hard to hear and can be eliminated
can be eliminated
21
IDC | Interaction Design Collegium
22
IDC | Interaction Design Collegium
23
IDC | Interaction Design Collegium
segments
24
IDC | Interaction Design Collegium
25
IDC | Interaction Design Collegium
26
IDC | Interaction Design Collegium
27
IDC | Interaction Design Collegium
cutscenes are stored in video
28
IDC | Interaction Design Collegium
using scripting languages or other tools.
rendering characters in closeup.
29
IDC | Interaction Design Collegium
face to form expressions
and tongue
hands
30
IDC | Interaction Design Collegium
game facilities and the action is recorded. Requires large “cast” and probably a lot of post-processing.
the normal level editor. Requires tool support and a strong scripting language.
if they were directors on a set controlling placement of cameras or actors.
31
IDC | Interaction Design Collegium
32
IDC | Interaction Design Collegium
statements or reactions
33
IDC | Interaction Design Collegium
character in shot
establishing position
which the camera can rarely cross without disorienting the audience and making them feel uncomfortable
the point from which that character emerges, to “balance” that action
34
IDC | Interaction Design Collegium
35
IDC | Interaction Design Collegium
http://xkcd.com
36
IDC | Interaction Design Collegium
37
IDC | Interaction Design Collegium
38
IDC | Interaction Design Collegium
39
IDC | Interaction Design Collegium
40
IDC | Interaction Design Collegium
41
IDC | Interaction Design Collegium
42
IDC | Interaction Design Collegium
43
IDC | Interaction Design Collegium
44
IDC | Interaction Design Collegium
45
IDC | Interaction Design Collegium
46
IDC | Interaction Design Collegium
47
IDC | Interaction Design Collegium
48
IDC | Interaction Design Collegium
49
IDC | Interaction Design Collegium
50
IDC | Interaction Design Collegium
51
IDC | Interaction Design Collegium
# Update the node N given the world matrix M function update(N : node, M : matrix) : bool # Calculate the absolute matrix of this node Matrix W = N.calcWorldMatrix(M) bool bv_changed = false # Visit the children for each child c in N: # Update this child bv_changed |= update(c, W) # Did the bounding volume change? if (bv_changed): # Recompute the bounding volumes of this node bv_changed = N.calcBoundingVolume() # Return the result return bv_changed
52
IDC | Interaction Design Collegium
# Render the node N using the abstract renderer R procedure render(N : node, R : renderer) # Set the current transformation matrix into the renderer R.loadMatrix(N.getWorldMatrix()) # Set renderer state (store old) R.pushState() R.setState(N.getRenderState()) # Visit the children for each child c in N: # Check the bounding volume of this child if (!R.isVisible(c)): continue # Render this child render(c, R) # Restore old render state R.popState()
53
IDC | Interaction Design Collegium
54
IDC | Interaction Design Collegium
55
IDC | Interaction Design Collegium
# Perform 3D picking of the node N using the ray R procedure pick(N : node, R : ray, L : node_list) # Adapt ray to current world matrix R.setTransform(N.getWorldMatrix()) # Visit the children for each child c in N: # Intersect ray with this bounding volume if (!R.intersects(c)): continue # Perform picking for this child pick(c, R, L)
56
IDC | Interaction Design Collegium
57
IDC | Interaction Design Collegium
58
IDC | Interaction Design Collegium
... // Create the node and entity SceneManager mSceneMgr = mRoot->getSceneManager(ST_EXTERIOR_CLOSE); SceneNode *node = mSceneMgr->getRootSceneNode()-> createChildSceneNode("Node1"); Entity *entity = mSceneMgr->createEntity("Mesh", "test.mesh"); node->attachObject(entity); // Transform the node node->translate(Vector3(10, 0, 10)); node->scale(0.5, 1, 2); node->yaw(Degree(-90)); ...
59