2
0

scene.lua 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. local scene = getSceneGraph()
  2. local events = getEventManager()
  3. local rot
  4. local node
  5. local inst
  6. local lcomp
  7. node = scene:newSector("sector0", "assets/sector.ankimesh")
  8. trf = Transform.new()
  9. trf:setOrigin(Vec4.new(0, 0, 0, 0))
  10. rot = Mat3x4.new()
  11. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  12. trf:setRotation(rot)
  13. trf:setScale(1.16458)
  14. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  15. node = scene:newModelNode("roomroom-materialnone0", "assets/roomroom-material.ankimdl")
  16. trf = Transform.new()
  17. trf:setOrigin(Vec4.new(0, 0, 0, 0))
  18. rot = Mat3x4.new()
  19. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  20. trf:setRotation(rot)
  21. trf:setScale(1)
  22. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  23. node = scene:newModelNode("columnroom-materialnone1", "assets/columnroom-material.ankimdl")
  24. trf = Transform.new()
  25. trf:setOrigin(Vec4.new(4.90187, 5.43441, -4.52919, 0))
  26. rot = Mat3x4.new()
  27. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  28. trf:setRotation(rot)
  29. trf:setScale(1)
  30. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  31. node = scene:newModelNode("columnroom-materialnone2", "assets/columnroom-material.ankimdl")
  32. trf = Transform.new()
  33. trf:setOrigin(Vec4.new(-4.59369, 5.43441, -4.49454, 0))
  34. rot = Mat3x4.new()
  35. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  36. trf:setRotation(rot)
  37. trf:setScale(1)
  38. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  39. node = scene:newModelNode("columnroom-materialnone3", "assets/columnroom-material.ankimdl")
  40. trf = Transform.new()
  41. trf:setOrigin(Vec4.new(-4.61101, 5.43441, 4.79029, 0))
  42. rot = Mat3x4.new()
  43. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  44. trf:setRotation(rot)
  45. trf:setScale(1)
  46. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  47. node = scene:newModelNode("columnroom-materialnone4", "assets/columnroom-material.ankimdl")
  48. trf = Transform.new()
  49. trf:setOrigin(Vec4.new(4.95098, 5.43441, 4.79029, 0))
  50. rot = Mat3x4.new()
  51. rot:setAll(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0)
  52. trf:setRotation(rot)
  53. trf:setScale(1)
  54. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  55. node = scene:newPointLight("Point")
  56. lcomp = node:getSceneNodeBase():getLightComponent()
  57. lcomp:setDiffuseColor(Vec4.new(2, 2, 2, 1))
  58. lcomp:setSpecularColor(Vec4.new(2, 2, 2, 1))
  59. lcomp:setRadius(12.77)
  60. trf = Transform.new()
  61. trf:setOrigin(Vec4.new(0.0680842, 9.57987, 0.0302386, 0))
  62. rot = Mat3x4.new()
  63. rot:setAll(1, 0, 0, 0, 0, 4.63287e-05, 1, 0, 0, -1, 4.63287e-05, 0)
  64. trf:setRotation(rot)
  65. trf:setScale(1)
  66. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  67. lcomp:setShadowEnabled(1)
  68. node = scene:newPerspectiveCamera("Camera")
  69. scene:setActiveCamera(node:getSceneNodeBase())
  70. node:setAll(1.5708, 1.0 / getMainRenderer():getAspectRatio() * 1.5708, 0.1, 100)
  71. trf = Transform.new()
  72. trf:setOrigin(Vec4.new(-0.0971127, 3.80237, 5.98675, 0))
  73. rot = Mat3x4.new()
  74. rot:setAll(1, 0, 0, 0, 0, 1, -4.63724e-05, 0, 0, 4.63724e-05, 1, 0)
  75. trf:setRotation(rot)
  76. trf:setScale(1)
  77. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)