TODO
author Radek Brich <radek.brich@devl.cz>
Fri, 23 Nov 2007 01:24:33 +0100
branchpyrit
changeset 10 f9fad94cd0cc
parent 7 bf17f9f84c91
child 11 4d192e13ee84
permissions -rw-r--r--
kd-tree: build algorithm tested and fixed exporting kd-tree to wavefront obj file (visualisation!)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
ce23c7deb2d3 added TODO
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
 * kd-tree
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
     2
 * transforms, camera
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
     3
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
     4
New Classes?
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
     5
============
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
     6
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
     7
container.h  -- Container
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
     8
kdtree.h  -- KdTree
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
     9
shapes.h  -- Triangle, Sphere
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    10
scene.h   -- Ray, Light, Camera, Scene
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    11
material.h -- Material, Texture
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    12
matrix.h  -- Matrix
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    13
vector.h  -- Vector3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    14
reader.h  -- Reader, WavefrontReader
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    15
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    16
KdTree top
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    17
wf = new WavefrontReader()
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    18
wf.setContainer(top)
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    19
wf.setTransform(monkey_pos_matrix)
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    20
wf.read("monkey.obj")
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    21
// more transform&reads
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    22
destroy wf
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    23
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    24
top.optimize()  -- i.e. build tree
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    25
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    26
Scene scene -- container with shapes, a camera and lights
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    27
scene = new Scene()
7
bf17f9f84c91 kd-tree: build algorithm - searching for all posible splits
Radek Brich <radek.brich@devl.cz>
parents: 6
diff changeset
    28
scene.setTop(top) -- top object in hierarchy
3
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    29
scene.setCamera(new Camera(pos, dir, angle))
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    30
scene.addLight(new PointLight(pos, color))
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    31
rt.setScene(scene)
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    32
rt.render(w,h)
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    33
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    34
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    35
constructors have zero or one parameter by default -- the object to copy data from
8f9cb0526c47 some notes in TODO
Radek Brich <radek.brich@devl.cz>
parents: 2
diff changeset
    36
more parameters -- the data (ray origin and direction)