Computer graphics and virtual reality again Flashcards
Describe the RGB color model
Red [0-1] (or [0-255])
Green [0-1]
Blue [0-1]
Describe (with text, figures and equations) the four steps for collision detection between two objects defined by triangle surfaces
- *Do a (fast) coarse “mini-max-test” with Bounding Boxes/Spheres to determine if a collision might be possible at all
- If yes, check if any of the points on body A is inside body B
—Test if any of the edges on body A intersects an infinite plane defined by some of the polygons on body B:
—Test if the endpoints of the edge are on different sides of the plane. This is done by using the equation of the plane. - If yes, calculate the intersection point between the edge and the plane:
—Use the equation for the line between the points and the equation of the plane. - Check if the intersection point is on the polygon:
—Calculate the area of the three sub triangles defined by the intersection point and the original vertices of the triangle.
—If all these areas have the same sign, the intersection point is inside the triangle and it is a collision.
—To speed up the calculation this can be done in 2D by projecting the triangle on a plane.
Bump-mapping is a way of using textures to give a smooth surface an irregular appearance. Describe how it works
- It works by modifying the surface normal that is used in the illumination model.
- The value of the modification is obtained from a texture.
- The color (RGB value) of each pixel indicates the surface normal modification.
Describe how Ray-Tracing and Radiosity work (Se bild!)
Ray-tracing:
- Follow light rays from the observer, one for each pixel
- Calculate how the ray is mirrored and refracted (if the object is transparent) when it hits surfaces in the model, and save the way in a tree graph
- Calculate the intensity at the initial points with illumination models
- Use the tree to calculate the intensities at each pixel
- Handles automatically shadows, hidden surfaces and clipping
Radiosity:
- Based on the effect that light sources and surfaces are emitting light
- Is done by iterating the emission of light
- In the first step only surfaces with direct light are visible
- In the next step these surfaces emits light to other surfaces
- This is repeated until the result is satisfactory
Mention two advantages and two disadvantages of Ray-Tracing and Radiosity
Ray-tracing:
Advantages:
- Good at transparent objects
- Handles specular reflection well
- Good at point light sources
Disadvantages:
- Unnaturally sharp shadows
- Bad at diffuse reflection
- Not good at global light sources
- Slow
Radiosity:
Advantages:
- Good at diffuse reflection
- Gives realistic shadows
- Good at global light sources
Disadvantages:
- Not good at specular reflection
- Not good for transparent objects
- Not good at point light sources
- Slow
Three different types of coordinate systems are used in virtual reality models (and also in CAD models). Specify these and what they are used for
- World coordinate system (w)
—a)Only one in each model
—b)The position of other objects are related to this - Object coordinate system
—a)One coordinate system per object in the model
—b)Positions the object relative to the world coordinate system or relative to a superseding object - The coordinate system of the observer (Virtual Observer)
—a)Makes it possible to travel around in the model
Light from a point light source can be reflected in two ways from a surface in a computer model, diffuse and specular. Describe the difference between diffuse and specular reflection.
Diffuse:
Light hitting the surface is spread equally in all directions => Placement of the light source influences but not the placement of the observer.
Specular:
The appearance of smooth, polished, surfaces is dependent of both the placement of the light source and the position of the observer, i.e. the light is reflected mostly in one direction.
Gouraud and Phong are two different methods to obtain smooth shading of triangulated surfaces. Why is Gouraud called vertex shading and Phong pixel shading?
Gouraud:
The color of a triangle is calculated at each vertex (corner) with the normal at that corner. The color is then interpolated over the surface of the triangle.
Phong:
The normal at the vertices (corners) are interpolated over the surface of the triangle and the color is calculated for each pixel.
Describe three different visualization systems for VR. Mention advantages and disadvantages with the different systems
Desktop (“Fishtank”) VR
PC (+track)(+glove)(+stereo glasses)
Advantages:
- High display resolution (1600x1200)
- Cheap
- Simple to use
Disadvantages:
- Narrow field of view (FOV)
- Low degree of immersion
- Not the natural scale (for e.g. cars)
Helmet (HMD)
Function:
- Some sort of helmet or glasses with one display for each eye
Advantages:
- Wider FOV
- Stereo viewing
- High degree of immersion
- Relatively cheap
- Simple to install
Disadvantages:
- Helmet weight 1 - 4 kg
- Isolation from the world
- Only one user
- Relatively low screen resolution
Powerwall (Large Volume Display)
Function:
- Two or more projectors working together
- Special software to coordinate the picture
Advantages:
- Wide FOV
- Natural size (cars)
- Stereo display (with shutter or polarized glasses)
- High resolution
Disadvantages:
- Not so high degree of immersion
- Advanced computers
- Advanced technology to obtain invisible edges between projectors
- Expensive
Describe how a shadow buffer can be used to create shadows (Se bild!)
(Se bild!)
- Create a buffer, corresponding to the depth buffer, containing the distance from the light source to the closest surface
- When drawing the point P on a surface
——Find the corresponding position in the shadow buffer for the point that is being drawn
——Compare the value in the shadow buffer with the distance from the light source to P
——If the value is less than the distance: draw only with ambient light
Describe how so called shutter glasses can be used to obtain stereo projection on an ordinary computer screen
- Gives 3D by “blocking” one eye at a time
- This synchronized with the computer which alternates between views for the left and right eye respectively
- The view are calculated with perspective projection
- The view for the left eye is calculated by moving the picture half the distance of the eyes to the left
- For the right eye the picture is moved the same distance to the right
What are homogenous coordinates and why are they used in computer graphics?
Homogenous coordinates are created by adding an extra coordinate, w, to the Cartesian coordinates.
They are used in order to simplify the calculation of transformations. With homogenous coordinates all the transformations can be calculated as a matrix multiplication which can be optimized for speed in the graphics processor.
Describe how Parallel and Perspective Projections are calculated. What is the visible difference (on screen) between the two projections?
(Se bild!)
Perspective projection:
- Project point on the projection plane with
similar triangles
- ekvationer, se bild!
- Object further away appears smaller
Parallel projection:
Simply set z=0;
Objects have the same size independent on the distance to
the observer