Josh Engebretson vor 11 Jahren
Ursprung
Commit
28e1756e14

+ 4 - 2
RoboMan/Resources/Components/RoboMan.js

@@ -12,15 +12,17 @@ function start() {
     var model = node.createComponent("AnimatedModel");
     model.setModel(cache.getResource("Model", "Models/RoboMan.mdl"));
     model.setMaterial(cache.getResource("Material", "Materials/Robot_01_Diffuse.xml"));
+
+    model.castShadows = true;
     
     var animCtrl = node.createComponent("AnimationController");
     animCtrl.playExclusive("Models/RoboMan_Normal_Run.ani", 0, true, 0.0);
 
-    game.cameraNode.position = [0, 2, -10];
+    game.cameraNode.position = [0, 5.5, -10];
+    game.cameraNode.pitch(20);
     
     node.yaw(180);
 
-
 }
 
 // we need an update or it doesn't run the start, fix in JSVM

+ 29 - 0
RoboMan/Resources/Components/Scene.js

@@ -6,12 +6,41 @@ var node = self.node;
 function start() {
 
 	var scene = game.scene;
+	var cache = game.cache;
+
+	// zone
+	var zoneNode = scene.createChild("Zone")
+    var zone = zoneNode.createComponent("Zone");
+    zone.boundingBox = [-1000, -1000, -1000, 1000, 1000 , 1000];
+    zone.ambientColor = [0.15, 0.15, 0.15];
+    zone.fogColor = [0.5, 0.5, 0.7, 1.0];
+    zone.fogStart = 10;
+    zone.fogEnd = 100;
+
 
     var lightNode = scene.createChild("Directional Light");
     lightNode.direction = [0.6, -1.0, 0.8];
     var light = lightNode.createComponent("Light")
     light.lightType = Atomic.LIGHT_DIRECTIONAL;
 
+    light.castShadows = true;
+    light.setShadowCascade(10.0, 50.0, 200.0, 0.0, 0.8);
+    light.setShadowBias(0.00025, 0.5);
+	light.specularIntensity = 8;
+
+    // create the grid plane
+    var planeNode = scene.createChild("Plane");
+    planeNode.scale = [100.0, 1.0, 100.0];
+    var planeObject = planeNode.createComponent("StaticModel");
+
+    var model = cache.getResource("Model", "Models/Plane.mdl");
+    var material = cache.getResource("Material", "Materials/BlueGrid.xml");
+
+    planeObject.model  = model;
+    planeObject.material = material;
+
+    
+
     // add the roboman
     var roboman = node.createChild("TheRoboMan");
     roboman.createJSComponent("RoboMan");

+ 7 - 0
RoboMan/Resources/Materials/BlueGrid.xml

@@ -0,0 +1,7 @@
+<material>
+    <technique name="Techniques/Diff.xml" quality="0" />
+    <texture unit="diffuse" name="Textures/BlueGrid.png" />
+    <parameter name="MatSpecColor" value="0.3 0.3 0.3 16" />
+    <parameter name="UOffset" value="32 0 0 0" />
+    <parameter name="VOffset" value="0 32 0 0" />
+</material>

BIN
RoboMan/Resources/Textures/BlueGrid.png