test_scene.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. {
  2. "metadata": {
  3. "formatVersion": 3.1,
  4. "type" : "scene"
  5. },
  6. "urlBaseType" : "relativeToHTML",
  7. "objects": {
  8. "cube1" : {
  9. "geometry" : "cubeNormals",
  10. "materials": [ "phong_red" ],
  11. "position" : [ 0, 0, 0 ],
  12. "rotation" : [ 0, -0.3, 0 ],
  13. "scale" : [ 1, 1, 1 ],
  14. "visible" : true,
  15. "properties" : {
  16. "rotating" : true,
  17. "rotateX" : true,
  18. "rotateY" : true
  19. }
  20. },
  21. "cube2" : {
  22. "geometry" : "cubeWire",
  23. "materials": [ "basic_white" ],
  24. "position" : [ 0, 0, 0 ],
  25. "rotation" : [ 0, -0.3, 0 ],
  26. "scale" : [ 2, 2, 2 ],
  27. "visible" : true
  28. },
  29. "cube3" : {
  30. "geometry" : "cube",
  31. "materials": [ "minecraft" ],
  32. "position" : [ -30, -5, 25 ],
  33. "rotation" : [ 0, 0.8, 0 ],
  34. "scale" : [ 1, 1, 1 ],
  35. "visible" : true
  36. },
  37. "sphere_lambert" : {
  38. "geometry" : "sphere",
  39. "materials": [ "lambert_green" ],
  40. "position" : [ -20, -5, 15 ],
  41. "rotation" : [ 0, 0, 0 ],
  42. "scale" : [ 1, 1, 1 ],
  43. "visible" : true
  44. },
  45. "sphere_refraction" : {
  46. "geometry" : "sphere",
  47. "materials": [ "basic_refraction" ],
  48. "position" : [ 50, 45, -50 ],
  49. "rotation" : [ 0, 0, 0 ],
  50. "scale" : [ 1, 1, 1 ],
  51. "visible" : true
  52. },
  53. "icosahedron" : {
  54. "geometry" : "icosahedron",
  55. "materials": [ "faceted_white" ],
  56. "position" : [ 20, 10, -60 ],
  57. "rotation" : [ 0, 0, 0 ],
  58. "scale" : [ 1, 1, 1 ],
  59. "visible" : true
  60. },
  61. "torus" : {
  62. "geometry" : "torus",
  63. "materials": [ "phong_orange" ],
  64. "position" : [ -20, 5, -50 ],
  65. "rotation" : [ 0, 0, 0 ],
  66. "scale" : [ 2, 2, 2 ],
  67. "visible" : true
  68. },
  69. "cone" : {
  70. "geometry" : "cone",
  71. "materials": [ "lambert_blue" ],
  72. "position" : [ -50, 15, -50 ],
  73. "rotation" : [ 0, 0, 0 ],
  74. "scale" : [ 1, 1, 1 ],
  75. "visible" : true
  76. },
  77. "cylinder" : {
  78. "geometry" : "cylinder",
  79. "materials": [ "lambert_blue" ],
  80. "position" : [ 50, 15, -50 ],
  81. "rotation" : [ 0, 0, 0 ],
  82. "scale" : [ 1, 1, 1 ],
  83. "visible" : true
  84. },
  85. "colorcube1" : {
  86. "geometry" : "colorcube",
  87. "materials": [],
  88. "position" : [ -10, -5, 30 ],
  89. "rotation" : [ 0, 0, 0 ],
  90. "scale" : [ 5, 5, 5 ],
  91. "visible" : true,
  92. "children" : {
  93. "colorcube2" : {
  94. "geometry" : "colorcube",
  95. "materials": [],
  96. "position" : [ 0, 2, 0 ],
  97. "rotation" : [ 0.1, 0.1, 0.1 ],
  98. "scale" : [ 0.5, 0.5, 0.5 ],
  99. "visible" : true,
  100. "children" : {
  101. "colorcube3" : {
  102. "geometry" : "colorcube",
  103. "materials": [],
  104. "position" : [ 0, 2, 0 ],
  105. "rotation" : [ 0.1, 0.1, 0.1 ],
  106. "scale" : [ 0.5, 0.5, 0.5 ],
  107. "visible" : true,
  108. "children" : {
  109. "colorcube4" : {
  110. "geometry" : "colorcube",
  111. "materials": [],
  112. "position" : [ 0, 2, 0 ],
  113. "rotation" : [ 0.1, 0.1, 0.1 ],
  114. "scale" : [ 0.5, 0.5, 0.5 ],
  115. "visible" : true
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "veyron" : {
  124. "geometry" : "veyron",
  125. "materials": [ "face" ],
  126. "position" : [ 40, -1, 0 ],
  127. "rotation" : [ 0, 0.3, 0 ],
  128. "scale" : [ 0.25, 0.25, 0.25 ],
  129. "visible" : true
  130. },
  131. "walt" : {
  132. "geometry" : "WaltHead",
  133. "materials": [ "lambert_cube" ],
  134. "position" : [ -75, 10, -30 ],
  135. "rotation" : [ 0, 0.5, 0 ],
  136. "scale" : [ 0.5, 0.5, 0.5 ],
  137. "visible" : true
  138. },
  139. "ben" : {
  140. "geometry" : "ben",
  141. "materials": [ "phong_ben" ],
  142. "position" : [ -45, -10, 0 ],
  143. "rotation" : [ 0, 0.5, 0 ],
  144. "scale" : [ 55, 55, 55 ],
  145. "visible" : true
  146. },
  147. "hand" : {
  148. "geometry" : "hand",
  149. "materials": [ "phong_hand" ],
  150. "position" : [ -28, -1, 29 ],
  151. "rotation" : [ 0, 0.5, 0 ],
  152. "scale" : [ 12, 12, 12 ],
  153. "visible" : true,
  154. "properties" : {
  155. "rotating" : true,
  156. "rotateY" : true
  157. }
  158. },
  159. "ninja" : {
  160. "geometry" : "NinjaLo",
  161. "materials": [ "phong_normal" ],
  162. "position" : [ 75, 10, -30 ],
  163. "rotation" : [ 0, -0.5, 0 ],
  164. "scale" : [ 1.25, 1.25, 1.25 ],
  165. "visible" : true
  166. },
  167. "sittingBox" : {
  168. "geometry" : "sittingBox",
  169. "materials": [ "phong_morph" ],
  170. "position" : [ -60, -10, 10 ],
  171. "rotation" : [ 0, 0.5, 0 ],
  172. "scale" : [ 23, 23, 23 ],
  173. "visible" : true,
  174. "morph" : true,
  175. "duration" : 8000,
  176. "mirroredLoop" : true
  177. },
  178. "quad_bg" : {
  179. "geometry" : "quad",
  180. "materials": [ "textured_bg" ],
  181. "position" : [ 0, 15, -90 ],
  182. "rotation" : [ 0, 0, 0 ],
  183. "scale" : [ 20, 20, 20 ],
  184. "visible" : true
  185. },
  186. "ground" : {
  187. "geometry" : "plane",
  188. "materials": [ "basic_gray" ],
  189. "position" : [ 0, -10, 0 ],
  190. "rotation" : [ -1.57, 0, 0 ],
  191. "scale" : [ 100, 100, 100 ],
  192. "visible" : true
  193. }
  194. },
  195. "geometries": {
  196. "cube": {
  197. "type" : "cube",
  198. "width" : 10,
  199. "height": 10,
  200. "depth" : 10,
  201. "segmentsWidth" : 1,
  202. "segmentsHeight" : 1,
  203. "segmentsDepth" : 1,
  204. "flipped" : false,
  205. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  206. },
  207. "cubeNormals": {
  208. "type" : "cube",
  209. "width" : 10,
  210. "height": 10,
  211. "depth" : 10,
  212. "segmentsWidth" : 1,
  213. "segmentsHeight" : 1,
  214. "segmentsDepth" : 1,
  215. "flipped" : false,
  216. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  217. },
  218. "cubeWire": {
  219. "type" : "cube",
  220. "width" : 10,
  221. "height": 10,
  222. "depth" : 10,
  223. "segmentsWidth" : 1,
  224. "segmentsHeight" : 1,
  225. "segmentsDepth" : 1,
  226. "flipped" : false,
  227. "sides" : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
  228. },
  229. "plane": {
  230. "type" : "plane",
  231. "width" : 10,
  232. "height" : 10,
  233. "segmentsWidth" : 50,
  234. "segmentsHeight" : 50
  235. },
  236. "quad": {
  237. "type" : "plane",
  238. "width" : 10,
  239. "height" : 10,
  240. "segmentsWidth" : 1,
  241. "segmentsHeight" : 1
  242. },
  243. "sphere": {
  244. "type" : "sphere",
  245. "radius" : 5,
  246. "segmentsWidth" : 32,
  247. "segmentsHeight" : 16
  248. },
  249. "icosahedron": {
  250. "type" : "icosahedron",
  251. "radius" : 20,
  252. "subdivisions" : 2
  253. },
  254. "torus": {
  255. "type" : "torus",
  256. "radius" : 5,
  257. "tube" : 2,
  258. "segmentsR" : 16,
  259. "segmentsT" : 32
  260. },
  261. "cylinder": {
  262. "type" : "cylinder",
  263. "topRad" : 5,
  264. "botRad" : 5,
  265. "height" : 50,
  266. "radSegs" : 32,
  267. "heightSegs": 1
  268. },
  269. "cone": {
  270. "type" : "cylinder",
  271. "topRad" : 0,
  272. "botRad" : 5,
  273. "height" : 50,
  274. "radSegs" : 32,
  275. "heightSegs" : 1
  276. },
  277. "WaltHead": {
  278. "type": "binary",
  279. "url" : "obj/walt/WaltHead_bin.js"
  280. },
  281. "NinjaLo": {
  282. "type": "binary",
  283. "url" : "obj/ninja/NinjaLo_bin.js"
  284. },
  285. "veyron": {
  286. "type": "binary",
  287. "url" : "obj/veyron/VeyronNoUv_bin.js"
  288. },
  289. "sittingBox": {
  290. "type": "ascii",
  291. "url" : "models/animated/sittingBox.js"
  292. },
  293. "ben": {
  294. "type": "ctm",
  295. "url" : "models/ctm/ben.ctm",
  296. "useWorkers" : true,
  297. "useBuffers" : true
  298. },
  299. "hand": {
  300. "type": "utf8",
  301. "url" : "models/utf8/hand.utf8",
  302. "scale" : 0.815141,
  303. "offsetX" : -0.371823,
  304. "offsetY" : -0.011920,
  305. "offsetZ" : -0.416061
  306. },
  307. "colorcube": {
  308. "type": "embedded",
  309. "id" : "cube_fvc"
  310. }
  311. },
  312. "embeds": {
  313. "cube_fvc": {
  314. "metadata" : {
  315. "formatVersion" : 3
  316. },
  317. "scale" : 1.0,
  318. "materials": [{
  319. "DbgColor" : 15658734,
  320. "DbgIndex" : 0,
  321. "DbgName" : "Material",
  322. "colorAmbient" : [0.0, 0.0, 0.0],
  323. "colorDiffuse" : [0.8, 0.8, 0.8],
  324. "colorSpecular" : [0.5, 0.5, 0.5],
  325. "specularCoef" : 50,
  326. "transparency" : 1.0,
  327. "vertexColors" : true
  328. }],
  329. "vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
  330. "morphTargets": [],
  331. "normals": [],
  332. "colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
  333. "uvs": [[]],
  334. "faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21]
  335. }
  336. },
  337. "materials": {
  338. "basic_gray": {
  339. "type": "MeshBasicMaterial",
  340. "parameters": { "color": 6710886, "wireframe": true }
  341. },
  342. "basic_white": {
  343. "type": "MeshBasicMaterial",
  344. "parameters": { "color": 16777215, "wireframe": true }
  345. },
  346. "faceted_white": {
  347. "type": "MeshLambertMaterial",
  348. "parameters": { "color": 16777215, "shading": "flat" }
  349. },
  350. "phong_red": {
  351. "type": "MeshPhongMaterial",
  352. "parameters": { "color": 16711680, "specular": 16711680, "shininess": 25, "bumpMap": "texture_bump", "bumpScale": -0.75 }
  353. },
  354. "phong_ben": {
  355. "type": "MeshPhongMaterial",
  356. "parameters": { "color": 1118481, "ambient": 1118481, "specular": 5601245, "shininess": 12, "bumpMap": "texture_bump_repeat", "bumpScale": 0.125 }
  357. },
  358. "phong_hand": {
  359. "type": "MeshPhongMaterial",
  360. "parameters": { "color": 14531481, "ambient": 14531481, "specular": 2236962, "shininess": 40, "wrapAround": true, "wrapRGB": [ 0.15, 0.02, 0.01 ] }
  361. },
  362. "phong_normal": {
  363. "type": "MeshPhongMaterial",
  364. "parameters": { "color": 0, "specular": 16777215, "shininess": 25, "envMap": "cube_reflection", "reflectivity": 0.1, "lightMap": "texture_ao", "normalMap": "texture_normal", "normalScale": [ 1, -1 ], "displacementMap": "texture_displacement", "displacementScale": 2.436143, "displacementBias": -0.428408 }
  365. },
  366. "phong_morph": {
  367. "type": "MeshPhongMaterial",
  368. "parameters": { "color": 0, "ambient": 0, "specular": 16777215, "shininess": 50, "envMap": "cube_reflection", "reflectivity": 0.125, "combine": "MixOperation", "shading": "flat", "side": "double", "morphTargets": true, "morphNormals" : true }
  369. },
  370. "lambert_green": {
  371. "type": "MeshLambertMaterial",
  372. "parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
  373. },
  374. "lambert_blue": {
  375. "type": "MeshLambertMaterial",
  376. "parameters": { "color": 21930 }
  377. },
  378. "phong_orange": {
  379. "type": "MeshPhongMaterial",
  380. "parameters": { "color": 0, "specular": 11162880 }
  381. },
  382. "basic_refraction": {
  383. "type": "MeshBasicMaterial",
  384. "parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
  385. },
  386. "lambert_cube": {
  387. "type": "MeshLambertMaterial",
  388. "parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
  389. },
  390. "chrome": {
  391. "type": "MeshLambertMaterial",
  392. "parameters": { "color": 16777215, "envMap": "cube_reflection" }
  393. },
  394. "darkerchrome": {
  395. "type": "MeshLambertMaterial",
  396. "parameters": { "color": 2236962, "envMap": "cube_reflection" }
  397. },
  398. "glass": {
  399. "type": "MeshLambertMaterial",
  400. "parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
  401. },
  402. "interior": {
  403. "type": "MeshLambertMaterial",
  404. "parameters": { "color": 328965 }
  405. },
  406. "backlights": {
  407. "type": "MeshLambertMaterial",
  408. "parameters": { "color": 16711680, "opacity": 0.5 }
  409. },
  410. "backsignals": {
  411. "type": "MeshLambertMaterial",
  412. "parameters": { "color": 16759552, "opacity": 0.5 }
  413. },
  414. "textured_bg": {
  415. "type": "MeshBasicMaterial",
  416. "parameters": { "color": 16777215, "map": "texture_bg" }
  417. },
  418. "minecraft": {
  419. "type": "MeshBasicMaterial",
  420. "parameters": { "color": 16777215, "map": "texture_minecraft" }
  421. },
  422. "face": {
  423. "type": "MeshFaceMaterial",
  424. "parameters": {}
  425. }
  426. },
  427. "textures": {
  428. "cube_reflection": {
  429. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  430. "textures/cube/SwedishRoyalCastle/nx.jpg",
  431. "textures/cube/SwedishRoyalCastle/py.jpg",
  432. "textures/cube/SwedishRoyalCastle/ny.jpg",
  433. "textures/cube/SwedishRoyalCastle/pz.jpg",
  434. "textures/cube/SwedishRoyalCastle/nz.jpg"
  435. ]
  436. },
  437. "cube_refraction": {
  438. "url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
  439. "textures/cube/SwedishRoyalCastle/nx.jpg",
  440. "textures/cube/SwedishRoyalCastle/py.jpg",
  441. "textures/cube/SwedishRoyalCastle/ny.jpg",
  442. "textures/cube/SwedishRoyalCastle/nz.jpg",
  443. "textures/cube/SwedishRoyalCastle/pz.jpg"
  444. ],
  445. "mapping": "CubeRefractionMapping"
  446. },
  447. "texture_bg": {
  448. "url": "textures/cube/SwedishRoyalCastle/pz.jpg",
  449. "anisotropy": 4
  450. },
  451. "texture_bump": {
  452. "url": "textures/water.jpg",
  453. "anisotropy": 4
  454. },
  455. "texture_bump_repeat": {
  456. "url": "textures/water.jpg",
  457. "repeat" : [ 20, 20 ],
  458. "anisotropy": 4
  459. },
  460. "texture_normal": {
  461. "url": "textures/normal/ninja/normal.jpg",
  462. "anisotropy": 4
  463. },
  464. "texture_ao": {
  465. "url": "textures/normal/ninja/ao.jpg",
  466. "anisotropy": 4
  467. },
  468. "texture_displacement": {
  469. "url": "textures/normal/ninja/displacement.jpg",
  470. "anisotropy": 4
  471. },
  472. "texture_minecraft": {
  473. "url": "textures/minecraft/grass.png",
  474. "magFilter": "NearestFilter",
  475. "minFilter": "LinearMipMapLinearFilter"
  476. }
  477. },
  478. "cameras": {
  479. "cam1": {
  480. "type" : "perspective",
  481. "fov" : 50,
  482. "aspect": 1.33333,
  483. "near" : 1,
  484. "far" : 1000,
  485. "position": [0,0,100],
  486. "target" : [0,0,0]
  487. },
  488. "cam2": {
  489. "type" : "ortho",
  490. "left" : 0,
  491. "right" : 1024,
  492. "top" : 0,
  493. "bottom": 1024,
  494. "near" : 1,
  495. "far" : 1000,
  496. "position": [0,0,0],
  497. "target" : [0,0,0]
  498. }
  499. },
  500. "lights": {
  501. "light1": {
  502. "type" : "directional",
  503. "direction" : [0,1,1],
  504. "color" : 16777215,
  505. "intensity" : 1
  506. },
  507. "light2": {
  508. "type" : "point",
  509. "position": [0,0,0],
  510. "color" : 16777215,
  511. "intensity" : 1.25
  512. }
  513. },
  514. "fogs": {
  515. "basic": {
  516. "type": "linear",
  517. "color": [1,0,0],
  518. "near": 1,
  519. "far": 1000
  520. },
  521. "exponential": {
  522. "type": "exp2",
  523. "color": [1,1,1],
  524. "density": 0.005
  525. },
  526. "black": {
  527. "type": "exp2",
  528. "color": [0,0,0],
  529. "density": 0.005
  530. }
  531. },
  532. "defaults": {
  533. "bgcolor": [0,0,0],
  534. "bgalpha": 1,
  535. "camera": "cam1",
  536. "fog": "black"
  537. }
  538. }