| author | Radek Brich <radek.brich@devl.cz> | 
| Sat, 17 Nov 2007 17:20:36 +0100 | |
| branch | pyrit | 
| changeset 4 | c73bc405ee7a | 
| parent 3 | 8f9cb0526c47 | 
| child 6 | d8d596d26f25 | 
| permissions | -rw-r--r-- | 
| 
4
 
c73bc405ee7a
multi-threaded rendering via pthreads
 
Radek Brich <radek.brich@devl.cz> 
parents: 
3 
diff
changeset
 | 
1  | 
* pthreads for Windows: http://sources.redhat.com/pthreads-win32/  | 
| 2 | 2  | 
* kd-tree  | 
| 3 | 3  | 
|
4  | 
||
5  | 
container.h -- Container  | 
|
6  | 
kdtree.h -- KdTree  | 
|
7  | 
shapes.h -- Triangle, Sphere  | 
|
8  | 
scene.h -- Ray, Light, Camera, Scene  | 
|
9  | 
material.h -- Material, Texture  | 
|
10  | 
matrix.h -- Matrix  | 
|
11  | 
vector.h -- Vector3  | 
|
12  | 
reader.h -- Reader, WavefrontReader  | 
|
13  | 
||
14  | 
KdTree monkey  | 
|
15  | 
wf = new WavefrontReader()  | 
|
16  | 
wf.setContainer(monkey)  | 
|
17  | 
wf.read("monkey.obj")
 | 
|
18  | 
destroy wf  | 
|
19  | 
||
20  | 
monkey.optimize() -- i.e. build tree  | 
|
21  | 
||
22  | 
Scene scene -- container with shapes, a camera and lights  | 
|
23  | 
scene = new Scene()  | 
|
24  | 
scene.setTop(monkey) -- top object in hierarchy  | 
|
25  | 
scene.setCamera(new Camera(pos, dir, angle))  | 
|
26  | 
scene.addLight(new PointLight(pos, color))  | 
|
27  | 
rt.setScene(scene)  | 
|
28  | 
rt.render(w,h)  | 
|
29  | 
||
30  | 
||
31  | 
constructors have zero or one parameter by default -- the object to copy data from  | 
|
32  | 
more parameters -- the data (ray origin and direction)  |