Skip to content

Commit

Permalink
add screenshots: overall screenshot, and demonstrating AABB error
Browse files Browse the repository at this point in the history
  • Loading branch information
EkkiD committed Oct 20, 2014
1 parent 8f701d5 commit 23297b2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
Binary file added modeller/AABBError.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modeller/StartScene.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions modeller/chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,11 @@ ray coordinate space as the third parameter. Each Node applies its own transform
``````````````````````````````````````````

The Ray-AABB selection approach is very simple to understand and implement. However, the results are wrong in certain situations.

For example, in the case of the `Sphere` primitive, the sphere itself only touches the AABB in the centre of each of its planes.
However if the user clicks on the corner of the Sphere's AABB, the collision will be detected with the Sphere, even if the user intended to click
past the Sphere onto something behind it.
![AABB Error](AABBError.png?raw=true)

This trade off between complexity, performance, and accuracy is common in computer graphics and in many areas of software engineering.

Expand Down Expand Up @@ -856,6 +858,7 @@ Finally, we translate the new node by the calculated vector.

## Summary
In this chapter, we examined a simple implementation of a 3D modeller.
![Sample Scene](StartScene.png?raw=true)
We saw how to develop a exensible data structure to represent the objects in the scene. We noticed that using the Composite design pattern and a tree
based data structure makes it easy to traverse the scene for rendering and interaction and allows us to add new types of nodes with no added complexity.
We leveraged this data structure to render the design to the screen, and manipulated OpenGL matrices in the traversal of the scene graph.
Expand Down
Binary file added modeller/newtranspipe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions modeller/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def init_scene(self):
def create_sample_scene(self):
cube_node = Cube()
cube_node.translate(2, 0, 2)
cube_node.color_index = 2
cube_node.color_index = 1
self.scene.add_node(cube_node)

sphere_node = Sphere()
Expand All @@ -74,7 +74,6 @@ def create_sample_scene(self):

hierarchical_node = SnowFigure()
hierarchical_node.translate(-2, 0, -2)
hierarchical_node.color_index = 1
self.scene.add_node(hierarchical_node)

def init_interaction(self):
Expand Down

0 comments on commit 23297b2

Please sign in to comment.