author | Radek Brich <radek.brich@devl.cz> |
Tue, 26 Jul 2016 17:41:36 +0200 | |
branch | pyrit |
changeset 103 | 3b3257a410fe |
parent 98 | 64638385798a |
permissions | -rw-r--r-- |
44 | 1 |
Container Usage |
2 |
--------------- |
|
3 |
(Container|Octree|KdTree) top; |
|
4 |
scene.setTop(top) // top object in hierarchy |
|
5 |
top.optimize() // build optimization structure |
|
45
76b254ce92cf
note for new camera classes
Radek Brich <radek.brich@devl.cz>
parents:
44
diff
changeset
|
6 |
|
76b254ce92cf
note for new camera classes
Radek Brich <radek.brich@devl.cz>
parents:
44
diff
changeset
|
7 |
Rework camera |
76b254ce92cf
note for new camera classes
Radek Brich <radek.brich@devl.cz>
parents:
44
diff
changeset
|
8 |
------------- |
46 | 9 |
Sampler - generate points in screen plane |
45
76b254ce92cf
note for new camera classes
Radek Brich <radek.brich@devl.cz>
parents:
44
diff
changeset
|
10 |
Camera - transform point from sampler to a ray |
94 | 11 |
|
12 |
New Classes? |
|
13 |
------------ |
|
14 |
||
15 |
scene.h -- Scene, ... |
|
16 |
reader.h -- Reader, WavefrontReader |
|
17 |
||
18 |
wf = new WavefrontReader() |
|
19 |
wf.setContainer(top) |
|
20 |
wf.setTransform(monkey_pos_matrix) |
|
21 |
wf.read("monkey.obj") |
|
22 |
// more transform&reads |
|
23 |
destroy wf |
|
24 |
||
25 |
Scene scene -- container with shapes, a camera and lights |
|
26 |
scene = new Scene() |
|
27 |
scene.setCamera(new Camera(eye, u, v, p)) |
|
28 |
scene.addLight(new PointLight(pos, color)) |
|
29 |
rt.setScene(scene) |
|
30 |
rt.render(w,h) |