Browse Source

babylon webgl stuff

Johann Woelper 8 years ago
parent
commit
f93c220ce4

File diff suppressed because it is too large
+ 41 - 0
the_west/Babylon.js


+ 20 - 0
the_west/data/island.babylon

@@ -0,0 +1,20 @@
+{"producer":{"name":"Blender","version":"2.78 (sub 0)","exporter_version":"5.1.0","file":"island.babylon"},
+"autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],
+"materials":[],
+"multiMaterials":[],
+"skeletons":[],
+"meshes":[{"name":"island","id":"island","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[1,1,1],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false
+,"positions":[-1,0.4546,0,-0.5556,0.1516,-0.5556,-0.75,0.4546,-0.75,-1,1,0,-0.75,0.4546,0.75,-0.5556,0.1516,0.5556,-0.75,0.0455,0,0,0.4546,1,0,1,1,0.75,0.4546,0.75,0.5556,0.1516,0.5556,0,0.0455,0.75,1,0.4546,0,1,1,0,0.75,0.4546,-0.75,0.5556,0.1516,-0.5556,0.75,0.0455,0
+,0,0.4546,-1,0,1,-1,0,0.0455,-0.75,0,-0.0908,0,0,1,0,0.75,1,0.75,-0.75,1,0.75,-0.75,1,-0.75,0.75,1,-0.75]
+,"normals":[-0.9591,-0.2831,0,-0.4469,-0.775,-0.4469,-0.6676,-0.3297,-0.6676,-0.7664,0.6424,0,-0.6676,-0.3297,0.6676,-0.4469,-0.775,0.4469,-0.5971,-0.8021,0,0,-0.2831,0.9591,0,0.6424,0.7664,0.6676,-0.3297,0.6676,0.4469,-0.775,0.4469,0,-0.8021,0.5971,0.9591,-0.2831,0,0.7664,0.6424,0,0.6676,-0.3297,-0.6676,0.4469,-0.775,-0.4469,0.5971,-0.8021,0
+,0,-0.2831,-0.9591,0,0.6424,-0.7664,0,-0.8021,-0.5971,0,-1,0,0,1,0,0.5554,0.6189,0.5554,-0.5554,0.6189,0.5554,-0.5554,0.6189,-0.5554,0.5554,0.6189,-0.5554]
+,"indices":[0,1,2,2,3,0,3,4,0,0,5,6,7,5,4,4,8,7,8,9,7,7,10,11,12,10,9,9,13,12,13,14,12,12,15,16,17,15,14,14,18,17,18,2,17,17,1,19,20,5
+,11,20,10,16,20,15,19,20,1,6,21,22,8,21,23,3,21,24,18,21,25,13,0,6,1,2,24,3,3,23,4,0,4,5,7,11,5,4,23,8,8,22,9,7,9,10,12,16,10,9
+,22,13,13,25,14,12,14,15,17,19,15,14,25,18,18,24,2,17,2,1,20,6,5,20,11,10,20,16,15,20,19,1,21,13,22,21,8,23,21,3,24,21,18,25]
+,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":26,"indexStart":0,"indexCount":144}]
+,"instances":[]}
+],
+"cameras":[{"name":"Camera","id":"Camera","position":[7.4811,5.3437,-6.5076],"rotation":[0.4615,-0.8149,0.0108],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"cameraRigMode":0,"interaxial_distance":0.0637,"type":"FreeCamera"}],"activeCamera":"Camera",
+"lights":[{"name":"Lamp","id":"Lamp","type":0,"position":[4.0762,5.9039,1.0055],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],
+"shadowGenerators":[]
+}

+ 22 - 0
the_west/data/island.log

@@ -0,0 +1,22 @@
+Exporter version: 5.1.0, Blender version: 2.78 (sub 0)
+========= Conversion from Blender to Babylon.js =========
+	Scene settings used:
+		selected layers only:  false
+		flat shading entire scene:  false
+		texture Method:  LEGACY
+		texture directory:  /Users/jwoelper/Documents/lab/the_west/data/
+	Python World class constructor completed
+	processing begun of mesh:  island
+		WARNING: No materials have been assigned: 
+		num positions      :  26
+		num normals        :  26
+		num uvs            :  0
+		num uvs2           :  0
+		num colors         :  0
+		num indices        :  144
+	processing begun of camera (FreeCamera):  Camera
+	processing begun of light (POINT):  Lamp
+========= Writing of scene file started =========
+========= Writing of scene file completed =========
+========= end of processing =========
+elapsed time:  0 min, 0.0058 secs

+ 33 - 0
the_west/data/scene.babylon

@@ -0,0 +1,33 @@
+{"producer":{"name":"Blender","version":"2.78 (sub 0)","exporter_version":"5.1.0","file":"scene.babylon"},
+"autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],
+"materials":[{"name":"scene.Material","id":"scene.Material","ambient":[0.8,0.8,0.8],"diffuse":[0.64,0.64,0.64],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true,"checkReadyOnlyOnce":false,"maxSimultaneousLights":4}],
+"multiMaterials":[],
+"skeletons":[],
+"meshes":[{"name":"island","id":"island","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[1,1,1],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false
+,"positions":[-1,0.4546,0,-0.5556,0.1516,-0.5556,-0.75,0.4546,-0.75,-1,1,0,-0.75,0.4546,0.75,-0.5556,0.1516,0.5556,-0.75,0.0455,0,0,0.4546,1,0,1,1,0.75,0.4546,0.75,0.5556,0.1516,0.5556,0,0.0455,0.75,1,0.4546,0,1,1,0,0.75,0.4546,-0.75,0.5556,0.1516,-0.5556,0.75,0.0455,0
+,0,0.4546,-1,0,1,-1,0,0.0455,-0.75,0,-0.0908,0,0,1,0,0.75,1,0.75,-0.75,1,0.75,-0.75,1,-0.75,0.75,1,-0.75]
+,"normals":[-0.9591,-0.2831,0,-0.4469,-0.775,-0.4469,-0.6676,-0.3297,-0.6676,-0.7664,0.6424,0,-0.6676,-0.3297,0.6676,-0.4469,-0.775,0.4469,-0.5971,-0.8021,0,0,-0.2831,0.9591,0,0.6424,0.7664,0.6676,-0.3297,0.6676,0.4469,-0.775,0.4469,0,-0.8021,0.5971,0.9591,-0.2831,0,0.7664,0.6424,0,0.6676,-0.3297,-0.6676,0.4469,-0.775,-0.4469,0.5971,-0.8021,0
+,0,-0.2831,-0.9591,0,0.6424,-0.7664,0,-0.8021,-0.5971,0,-1,0,0,1,0,0.5554,0.6189,0.5554,-0.5554,0.6189,0.5554,-0.5554,0.6189,-0.5554,0.5554,0.6189,-0.5554]
+,"indices":[0,1,2,2,3,0,3,4,0,0,5,6,7,5,4,4,8,7,8,9,7,7,10,11,12,10,9,9,13,12,13,14,12,12,15,16,17,15,14,14,18,17,18,2,17,17,1,19,20,5
+,11,20,10,16,20,15,19,20,1,6,21,22,8,21,23,3,21,24,18,21,25,13,0,6,1,2,24,3,3,23,4,0,4,5,7,11,5,4,23,8,8,22,9,7,9,10,12,16,10,9
+,22,13,13,25,14,12,14,15,17,19,15,14,25,18,18,24,2,17,2,1,20,6,5,20,11,10,20,16,15,20,19,1,21,13,22,21,8,23,21,3,24,21,18,25]
+,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":26,"indexStart":0,"indexCount":144}]
+,"instances":[]}
+,{"name":"ship","id":"ship","materialId":"scene.Material","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[5,2.5,15],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false
+,"positions":[0,-1,1,-0.7306,-1,-1,-0.7306,-1,1,0,1,1,-1,1,-1,0,1,-1.224,1,1,1,1,0,-1,1,0,1,0,1,-1.224,-1,0,-1,0,0,-1.224,-1,1,-1,-1,0,1,-1,0,-1,0,0,1,-0.7306,-1,1
+,-1,0,1,0.7306,-1,1,1,0,1,1,1,-1,1,0,-1,1,1,-1,1,1,1,0.7306,-1,-1,0.7306,-1,1,0.7306,-1,-1,0,-1,-1.1687,0,1,1,1,1,1,-1,1,1,-0.7306,-1,1,-0.7306,-1,-1,-0.7306,-1,-1
+,0.7306,-1,-1,0.7306,-1,1,0,-1,-1.1687,-1,1,1,1,1,-1,-1,1,-1,-1,1,1,0,-1,1]
+,"normals":[0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,1,0,0,0.9913,-0.1312,0,0.9913,-0.1312,0,0,0,-1,-0.2185,-0.0268,-0.9755,0,-0.029,-0.9996,-1,0,0,-0.9913,-0.1312,0,-0.9913,-0.1312,0,0,0,1,0,0,1
+,0,0,1,0,0,1,0,0,1,0.2186,0,-0.9758,0.2185,-0.0268,-0.9755,0,1,0,0,1,0,0,-1,0,0,-1,0,0.2215,-0.0562,-0.9735,0,-0.0552,-0.9985,0,0,1,0,0,1,0,0,1,-0.9656,-0.2601,0,-0.9656,-0.2601,0,-0.2215,-0.0562,-0.9735
+,0.9656,-0.2601,0,0.9656,-0.2601,0,0,-1,0,0,1,0,1,0,0,-0.2186,0,-0.9758,-1,0,0,0,0,1]
+,"uvs":[0.3334,0.5,0.0001,0.3334,0.3334,0.3334,0.5002,0.6666,0.3336,0.3334,0.5002,0.3334,0.3334,0.9999,0.0001,0.8333,0.3334,0.8333,0.5002,0.3334,0.3336,0.1667,0.5002,0.1667,0.0001,0.0001,0.3334,0.1667,0.0001,0.1667,0.5002,0.8333,0.3336,0.9999,0.3336,0.8333,0.6669,0.9999,0.6669,0.8333,0.6669,0.3334,0.6669,0.1667,0.6669,0.3334,0.6669,0.6666,0.0001,0.6666
+,0.3334,0.6666,0.6669,0.0001,0.5002,0.0001,0.5002,0.6666,0.6669,0.6666,0.3336,0.6666,0.3334,0.3334,0.0001,0.3334,0.3336,0.0001,0.0001,0.6666,0.3334,0.6666,0.0001,0.5,0.3336,0.6666,0.0001,0.9999,0.3336,0.3334,0.3334,0.0001,0.5002,0.9999]
+,"indices":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,15,19,20,11,21,3,22,23,24,0,25,26,11,27,19,28,29,15,30,28,14,31,32,11,33,27,8,34,35,0,36
+,1,3,37,4,6,38,7,9,39,10,12,40,13,15,41,16,18,41,15,20,9,11,3,5,22,24,36,0,26,21,11,19,15,28,15,17,30,14,13,31,11,10,33,8,7,34]
+,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":42,"indexStart":0,"indexCount":96}]
+,"instances":[]}
+],
+"cameras":[{"name":"Camera","id":"Camera","position":[7.4811,5.3437,-6.5076],"rotation":[0.4615,-0.8149,0.0108],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"cameraRigMode":0,"interaxial_distance":0.0637,"type":"FreeCamera"}],"activeCamera":"Camera",
+"lights":[{"name":"Sun","id":"Sun","type":1,"position":[7.0648,6.9294,0],"direction":[-0.8992,-0.4132,0.1437],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],
+"shadowGenerators":[]
+}

+ 30 - 0
the_west/data/scene.log

@@ -0,0 +1,30 @@
+Exporter version: 5.1.0, Blender version: 2.78 (sub 0)
+========= Conversion from Blender to Babylon.js =========
+	Scene settings used:
+		selected layers only:  false
+		flat shading entire scene:  false
+		texture Method:  LEGACY
+		texture directory:  /Users/jwoelper/Documents/lab/the_west/data/
+	Python World class constructor completed
+	processing begun of mesh:  island
+		WARNING: No materials have been assigned: 
+		num positions      :  26
+		num normals        :  26
+		num uvs            :  0
+		num uvs2           :  0
+		num colors         :  0
+		num indices        :  144
+	processing begun of mesh:  ship
+		processing begun of Standard material:  Material
+		num positions      :  42
+		num normals        :  42
+		num uvs            :  84
+		num uvs2           :  0
+		num colors         :  0
+		num indices        :  96
+	processing begun of camera (FreeCamera):  Camera
+	processing begun of light (SUN):  Sun
+========= Writing of scene file started =========
+========= Writing of scene file completed =========
+========= end of processing =========
+elapsed time:  0 min, 0.0074 secs

+ 23 - 0
the_west/data/ship.babylon

@@ -0,0 +1,23 @@
+{"producer":{"name":"Blender","version":"2.78 (sub 0)","exporter_version":"5.1.0","file":"ship.babylon"},
+"autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],
+"materials":[{"name":"ship.Material","id":"ship.Material","ambient":[0.8,0.8,0.8],"diffuse":[0.64,0.64,0.64],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true,"checkReadyOnlyOnce":false,"maxSimultaneousLights":4}],
+"multiMaterials":[],
+"skeletons":[],
+"meshes":[{"name":"ship","id":"ship","materialId":"ship.Material","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[5,2.5,15],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false
+,"positions":[0,-1,1,-0.7306,-1,-1,-0.7306,-1,1,0,1,1,-1,1,-1,0,1,-1.224,1,1,1,1,0,-1,1,0,1,-1,0,-1,0,0,-1.224,-1,1,-1,-1,0,1,-1,0,-1,0,0,1,-0.7306,-1,1,-1,0,1
+,0.7306,-1,1,1,0,1,1,1,-1,1,0,-1,1,1,1,0.7306,-1,-1,0.7306,-1,1,0.7306,-1,-1,0,-1,-1.1687,1,0,1,1,1,1,-1,1,1,-1,0,-1,-0.7306,-1,-1,0.7306,-1,1,0,-1,-1.1687,1,1,-1
+,-1,1,-1,-1,1,1,0,-1,1,-0.7306,-1,1,0,-1,1,0,-1,-1.1687,0.7306,-1,-1,1,0,-1,1,0,1,-1,0,1,-1,0,-1,-0.7306,-1,-1]
+,"normals":[0,-0.7071,0.7071,-0.5504,-0.6614,-0.5095,-0.49,-0.6394,0.5925,0,0.7071,0.7071,-0.6303,0.5898,-0.5047,0,0.661,-0.7503,0.5773,0.5773,0.5773,0.7931,-0.1036,-0.6001,0.728,-0.0963,0.6787,-0.7931,-0.1036,-0.6001,0,-0.029,-0.9996,-0.6303,0.5898,-0.5047,-0.728,-0.0963,0.6787,-0.7931,-0.1036,-0.6001,0,0,1,-0.49,-0.6394,0.5925,-0.728,-0.0963,0.6787
+,0.49,-0.6394,0.5925,0.728,-0.0963,0.6787,0.6303,0.5898,-0.5047,0.7931,-0.1036,-0.6001,0.5773,0.5773,0.5773,0.5504,-0.6614,-0.5095,0.49,-0.6394,0.5925,0.5504,-0.6614,-0.5095,0,-0.6801,-0.7331,0.728,-0.0963,0.6787,0.5773,0.5773,0.5773,-0.5773,0.5773,0.5773,-0.7931,-0.1036,-0.6001,-0.5504,-0.6614,-0.5095,0.49,-0.6394,0.5925,0,-0.6801,-0.7331,0.6303,0.5898,-0.5047
+,-0.6303,0.5898,-0.5047,-0.5773,0.5773,0.5773,0,-0.7071,0.7071,-0.49,-0.6394,0.5925,0,-0.7071,0.7071,0,-0.6801,-0.7331,0.5504,-0.6614,-0.5095,0.7931,-0.1036,-0.6001,0.728,-0.0963,0.6787,-0.728,-0.0963,0.6787,-0.7931,-0.1036,-0.6001,-0.5504,-0.6614,-0.5095]
+,"uvs":[0.3334,0.5,0.0001,0.3334,0.3334,0.3334,0.5002,0.6666,0.3336,0.3334,0.5002,0.3334,0.3334,0.9999,0.0001,0.8333,0.3334,0.8333,0.3336,0.1667,0.5002,0.1667,0.0001,0.0001,0.3334,0.1667,0.0001,0.1667,0.5002,0.8333,0.3336,0.9999,0.3336,0.8333,0.6669,0.9999,0.6669,0.8333,0.6669,0.3334,0.6669,0.1667,0.6669,0.6666,0.0001,0.6666,0.3334,0.6666,0.6669,0.0001
+,0.5002,0.0001,0.6669,0.8333,0.6669,0.6666,0.3336,0.6666,0.0001,0.1667,0.3336,0.0001,0.3334,0.6666,0.0001,0.5,0.0001,0.9999,0.0001,0.0001,0.3334,0.0001,0.5002,0.9999,0.3336,0.9999,0.5002,0.9999,0.0001,0.5,0.6669,0.0001,0.6669,0.1667,0.6669,0.8333,0.3336,0.8333,0.0001,0.1667,0.3336,0.0001]
+,"indices":[0,1,2,3,4,5,6,7,8,5,9,10,11,12,13,14,15,16,17,14,18,19,10,20,3,19,21,22,0,23,24,10,25,26,3,27,14,28,3,29,2,1,10,30,25,8,22,31,0,32
+,1,3,28,4,6,33,7,5,4,9,34,35,12,14,36,37,17,38,14,19,5,10,3,5,19,22,39,0,40,41,10,42,14,3,14,43,28,44,12,2,10,9,45,8,7,22]
+,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":46,"indexStart":0,"indexCount":96}]
+,"instances":[]}
+],
+"cameras":[{"name":"Camera","id":"Camera","position":[7.4811,5.3437,-6.5076],"rotation":[0.4615,-0.8149,0.0108],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"cameraRigMode":0,"interaxial_distance":0.0637,"type":"FreeCamera"}],"activeCamera":"Camera",
+"lights":[{"name":"Lamp","id":"Lamp","type":0,"position":[4.0762,5.9039,1.0055],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],
+"shadowGenerators":[]
+}

+ 22 - 0
the_west/data/ship.log

@@ -0,0 +1,22 @@
+Exporter version: 5.1.0, Blender version: 2.78 (sub 0)
+========= Conversion from Blender to Babylon.js =========
+	Scene settings used:
+		selected layers only:  false
+		flat shading entire scene:  false
+		texture Method:  LEGACY
+		texture directory:  /Users/jwoelper/Documents/lab/the_west/data/
+	Python World class constructor completed
+	processing begun of mesh:  ship
+		processing begun of Standard material:  Material
+		num positions      :  46
+		num normals        :  46
+		num uvs            :  92
+		num uvs2           :  0
+		num colors         :  0
+		num indices        :  96
+	processing begun of camera (FreeCamera):  Camera
+	processing begun of light (POINT):  Lamp
+========= Writing of scene file started =========
+========= Writing of scene file completed =========
+========= end of processing =========
+elapsed time:  0 min, 0.0041 secs

File diff suppressed because it is too large
+ 11364 - 0
the_west/data/sundew_engine.babylon


+ 22 - 0
the_west/data/sundew_engine.log

@@ -0,0 +1,22 @@
+Exporter version: 5.1.0, Blender version: 2.78 (sub 0)
+========= Conversion from Blender to Babylon.js =========
+	Scene settings used:
+		selected layers only:  false
+		flat shading entire scene:  false
+		texture Method:  LEGACY
+		texture directory:  /Users/jwoelper/Documents/lab/the_west/data/
+	Python World class constructor completed
+	processing begun of camera (FreeCamera):  Camera
+	processing begun of mesh:  sundew
+		WARNING: No materials have been assigned: 
+		num positions      :  58637
+		num normals        :  58637
+		num uvs            :  117274
+		num uvs2           :  0
+		num colors         :  0
+		num indices        :  105210
+	processing begun of light (SUN):  Sun
+========= Writing of scene file started =========
+========= Writing of scene file completed =========
+========= end of processing =========
+elapsed time:  0 min, 3.2236 secs

BIN
the_west/data/sundew_engine_Hull_Circle_012_s_metal_DIFFUSE.jpg


+ 51 - 0
the_west/index.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>Using babylon.js - How to load a scene</title>
+    <script src="babylon.js"></script>
+    <style>
+        html, body {
+            width: 100%;
+            height: 100%;
+            padding: 0;
+            margin: 0;
+            overflow: hidden;
+        }
+
+        #renderCanvas {
+            width: 100%;
+            height: 100%;
+        }
+    </style>
+</head>
+<body>
+    <canvas id="renderCanvas"></canvas>
+
+    <script>
+    if (BABYLON.Engine.isSupported()) {
+        var canvas = document.getElementById("renderCanvas");
+        var engine = new BABYLON.Engine(canvas, true);
+
+        BABYLON.SceneLoader.Load("data/", "sundew_engine.babylon", engine, function (newScene) {
+            // Wait for textures and shaders to be ready
+            newScene.executeWhenReady(function () {
+                // Attach camera to canvas inputs
+                newScene.activeCamera.attachControl(canvas);
+
+
+                // Once the scene is loaded, just register a render loop to render it
+                engine.runRenderLoop(function() {
+
+                    newScene.render();
+
+                });
+            });
+        }, function (progress) {
+            // To do: give progress feedback to user
+        });
+    }
+</script>
+
+
+ </body>
+</html>

BIN
the_west/source/test.blend