TODO
branchpyrit
changeset 3 8f9cb0526c47
parent 2 ce23c7deb2d3
child 4 c73bc405ee7a
equal deleted inserted replaced
2:ce23c7deb2d3 3:8f9cb0526c47
     1  * pthreads (pro Windows http://sources.redhat.com/pthreads-win32/)
     1  * pthreads (pro Windows http://sources.redhat.com/pthreads-win32/)
     2  * kd-tree
     2  * kd-tree
       
     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)