Well i finally wrote a working scene loader!!! its based off of the .obj format. here's an example:
Code: Select all
# Blender3D v244 OBJ File:
# www.blender3d.org
camera
3.0000 0.00000 0.0000
0.0000 0.00000 0.0000
-0.1000 0.0000 1.0000
30
m
white
diff
.9 0.9 0.9
m
red
diff
1.0 0.0 0.0
m
blue
diff
0.0 0.0 1.0
m
glow
emit
0.95 0.99 0.98
4
m
gold
phong
1 .58 0.068
10
o sphere
gold
.5
-2.5 -1 0
o mesh
v -1.968028 1.782439 -0.859092
v -1.968028 1.782439 0.649258
v -3.384994 1.782439 0.649258
v -3.384994 1.782439 -0.859092
v 3.988001 -1.701115 -1.855010
v 3.988001 -1.701115 1.790176
v -3.993612 -1.701115 1.790175
v -3.993610 -1.701115 -1.855011
v 3.988003 1.815896 -1.855009
v 3.987998 1.815896 1.790176
v -3.993613 1.815896 1.790175
v -3.993612 1.815896 -1.855010
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 -0.000001
vn 1.000000 -0.000001 0.000000
vn 1.000000 0.000001 0.000001
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 -1.000000
mat white
f 7 // 1 11 // 1 12 // 1
f 7 // 2 12 // 2 8 // 2
f 5 // 3 9 // 3 6 // 3
f 9 // 4 10 // 4 6 // 4
f 9 // 5 12 // 5 10 // 5
f 12 // 5 11 // 5 10 // 5
f 5 // 6 6 // 6 8 // 6
f 6 // 6 7 // 6 8 // 6
mat red
f 6 // 7 10 // 7 7 // 7
f 10 // 7 11 // 7 7 // 7
mat blue
f 9 // 8 5 // 8 12 // 8
f 5 // 8 8 // 8 12 // 8
mat glow
f 1 // 5 4 // 5 3 // 5
f 1 // 5 3 // 5 2 // 5
}
the only difference between this and the one in the picture is that the sphere is a different color.
currently there are only two types of objects: sphere objects which are limited in the data input, and mesh objects which can have as many virts as you need them to. because of this, there is an ending bracket when the mesh object is over to signify it is over, however it does not have a starting braket. in my actual program right now meshes are just transformed into individual triangles, because my mesh object is too slow. the camera is specified by point- point- up vector- appature. there is something wrong currently with how i set up the camera, so only use a square picture at the moment and crop it later. i might work on a python exporter now, even though i don't know python or python in blender. if anybody wants to help, i would highly appreciate it.
attached is .jar executable for the first version 0.1 Betta 1 of TLRcam. its simple enough to use so i wont explain it. only think i must say is use the buttons, not the drop down menus.
oh, and TLR stands for thin lens reflex (as opposed to single lens reflex)