comp graph

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/51

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:52 AM on 5/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

52 Terms

1
New cards

Update function (to update all game objects), Render function (each object renders itself), Collision checking, and Transform functions for placement and rendering.

What are the four primitive requirements of a game engine?

2
New cards

Iterates through all objects and calls each one's update() function, then destroys any objects marked for removal and performs housekeeping.

What is the purpose of UpdateAll() in a game engine?

3
New cards

Called AFTER UpdateAll(). Erases the screen, draws the background, then calls each object's render() function.

What is the purpose of RenderAll() in a game engine?

4
New cards

VisualObjects (render/physics only), SolidObjects (act as blockers), and TriggerObjects (cause events on collision).

What are the three object arrays in the primitive game engine?

5
New cards

Deleting from a regular array leaves a null/hole at that index. Deleting from an associative array leaves no holes in the data.

Why use associative arrays instead of regular arrays for game objects?

6
New cards

An associative array that holds pointers to the object types (classes) that can be spawned/created.

What is a 'prefab' in the game engine context?

7
New cards

loc (x,y,z position), rot (Euler rotation), collisionRadius, velocity, angVelocity, name, id, and prefabID.

What properties does a GameObject have?

8
New cards

By concatenating "ID" with the current object counter (e.g., "ID0", "ID1", etc.).

How is an object's ID derived in the game engine?

9
New cards

Total Range = radius1 + radius2. Collision if (|obj2.x - obj1.x| < Total Range && |obj2.y - obj1.y| < Total Range). Add Z axis for cube.

What is the formula for a square/cube collider collision check?

10
New cards

Distance = sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²). Collision if Distance < (radius1 + radius2).

What is the formula for a circle/sphere collider?

11
New cards

Only the MOVING objects check for collision — stationary objects do not.

Which objects are responsible for checking collisions?

12
New cards

To check for collisions first before committing the move, preventing screen shake if blocked by a solid object.

Why should you calculate the NEXT position before updating an object's x/y/z?

13
New cards

Type (0 = visual, 1 = solid, 2 = trigger) and location/rotation. The object's class is also passed in.

What is the convention for CreateObject() parameters?

14
New cards

KeyD (calls main instance's KeyDown), MouseH (calls main instance's MouseClick), and MainLoop (the requestAnimationFrame driver).

What static functions does the Main class have?

15
New cards

1) Work in application units, 2) Position camera independently, 3) Define clipping volume in app units, 4) Support parallel or perspective projection.

What are the four requirements for viewing in WebGL?

16
New cards

It doesn't — instead, the inverse of the camera transformations is applied to the entire world.

How does WebGL actually 'move the camera'?

17
New cards

| 1 0 0 -X | | 0 1 0 -Y | | 0 0 1 -Z | | 0 0 0 1 | (negative values applied to world)

What is the camera translation matrix for moving the camera by (X, Y, Z)?

18
New cards

| 1/r 0 0 0 | | 0 1/t 0 0 | | 0 0 1 0 | | 0 0 0 1 | where r=right, t=top

What is the simplified Orthographic Projection matrix (centered at origin)?

19
New cards

| N/R 0 0 0 | | 0 N/T 0 0 | | 0 0 -(F+N)/(F-N) -2FN/(F-N) | | 0 0 -1 0 |

What is the full (simplified) Perspective matrix you need to know?

20
New cards

N must be > 0. For no distortion with aspect ratio 1, N must equal L must equal T.

What constraint must N (near plane) satisfy in a perspective matrix?

21
New cards

| Rx Ux Fx Tx | | Ry Uy Fy Ty | | Rz Uz Fz Tz | | 0 0 0 1 | where R, U, F are normalized right/up/forward vectors.

What is the LookAt matrix?

22
New cards

They are in terms of the NEW coordinate frame. Apply translation BEFORE LookAt if you want movement in global space.

What is the rule for the translation values (Tx, Ty, Tz) in the LookAt matrix?

23
New cards

gl.enable(gl.DEPTH_TEST) for depth test; gl.enable(gl.CULL_FACE) + gl.cullFace(gl.BACK or gl.FRONT) for culling.

How do you enable hidden surface removal and face culling in WebGL?

24
New cards

The Law of Conservation of Energy — some light is absorbed and some is reflected when hitting a surface.

What is the law that light must follow?

25
New cards

It models infinite scattering and absorption globally (shadows, multiple reflections), which is computationally impossible in real-time.

Why is the Rendering Equation not solvable in real-time graphics?

26
New cards

Point source, Distant/Directional light (parallel, like sunlight), Spotlight (restricted angle point light), and Ambient light (uniform everywhere).

What are the four types of simplified light sources?

27
New cards

Diffuse, Specular, and Ambient.

What are the three components of the Phong lighting model?

28
New cards

To Source (light direction), To Viewer (view direction), Normal (surface normal), and Perfect Reflector (ideal reflection vector).

What are the four vectors used in the Phong model?

29
New cards

r = 2(l · n)n - l where l is the light direction and n is the surface normal.

What is the formula for the ideal reflector vector?

30
New cards

It is a perfectly diffuse reflector — light scatters equally in all directions; brightness is proportional to the cosine of the angle of incidence.

What does a Lambertian surface do?

31
New cards

Higher values (100–200) = metal-like tight highlight; lower values (5–10) = plastic-like broad highlight.

How does the shininess coefficient affect specular reflection?

32
New cards

Directional light is assumed to be infinitely far away, so all rays are parallel and strike every surface at the same angle.

Why is the position of a directional light not important?

33
New cards

Normalize both the surface normal and the light direction vector, then take their dot product. Clamp the minimum to 0.

How do you calculate intensity for a directional light?

34
New cards

For each vertex, calculate the specific direction from that vertex to the light source, since it differs for every vertex.

What extra calculation is needed for a point light vs. a directional light?

35
New cards

Multiply the dot product result by (Intensity / distance from light), which reduces the effect at greater distances.

How can you limit the range of a point light?

36
New cards

A spotlight limits the angles it illuminates, using an additional dot product to restrict the cone of light.

What is the key difference between a point light and a spotlight?

37
New cards

1) Specify texture in texture object, 2) Set filter, 3) Set texture function, 4) Set wrap mode, 5) Set perspective correction hint, 6) Bind texture object, 7) Enable texturing, 8) Supply texture coordinates per vertex.

What are the 8 steps for using textures in WebGL?

38
New cards

gl.CLAMP (clamps values to edge color) and gl.REPEAT (tiles the texture). There is also mirrored repeat.

What are the two texture wrapping modes?

39
New cards

When one texel (texture pixel) covers MORE than one screen pixel — the texture is being stretched.

What is Magnification in texturing?

40
New cards

When more than one texel maps to a single screen pixel — the texture is being compressed.

What is Minification in texturing?

41
New cards

Parametric coordinates, Texture coordinates (s,t), Object/World coordinates, and Window coordinates.

What are the four coordinate systems involved in texture mapping?

42
New cards

First mapping the texture onto a simple intermediate surface (like a cylinder, sphere, or box), then mapping from that intermediate shape to the actual object.

What is Two-Part Mapping?

43
New cards

A technique that pre-generates texture maps at multiple (decreasing) resolutions to reduce interpolation errors for small/distant textured objects.

What is Mipmapping?

44
New cards

A technique to simulate highly reflective surfaces without ray-tracing by mapping the surrounding scene onto a simple intermediate shape (cube, sphere, cylinder) and using it as a texture.

What is Environment (Reflection) Mapping?

45
New cards

textureCube(mycube, texcoord) with 3D texture coordinates (usually the vertex position).

What cube map sampler does WebGL use?

46
New cards

Assumes environment is very far; objects can't be concave (no self-reflection); no reflection between objects; needs a new map per object and per viewer position change.

What are the limitations of Environment Mapping?

47
New cards

A technique that perturbs the surface normals at each fragment to simulate surface roughness/bumps under lighting, without actually changing the geometry.

What is Bump Mapping?

48
New cards

As a 2D array (texture image) of normal perturbation values, applied in the fragment shader to alter normals before lighting calculations.

How is a bump map stored and applied?

49
New cards

Point sampling picks the nearest texel; linear filtering averages surrounding texels. Linear filtering reduces aliasing artifacts.

What is the difference between point sampling and linear filtering in texturing?

50
New cards

Images and geometry flow through SEPARATE pipelines that only join at the fragment processor, allowing them to run in parallel.

Why does texture complexity not affect geometry transform performance?

51
New cards

FALSE. An object appears red because it REFLECTS red wavelengths and absorbs all other colors.

T/F: When an object appears red, it is absorbing red light.

52
New cards

An approximation of light reflected everywhere in the scene. It is most useful when directional/point light is very low. It is a scalar < 1 multiplied by the object's RGB color.

What is ambient light and when is it needed?