Dinkelborg Posted October 21, 2014 Share Posted October 21, 2014 Hi, I basically spend all day trying to make a very simple scene with a spinning box that simply casts a shadow >> http://playground.babylonjs.com/#1WTS3Q while doing so I think I found a bug, my original plan was to have a light source pointing straight down so I set the directional lights target parameter to a Vector(0,-1,0) as it is also shown in this example in the tutorials Quote var light0 = new BABYLON.DirectionalLight("Dir0", new BABYLON.Vector3(0, -1, 0), scene);light0.diffuse = new BABYLON.Color3(1, 0, 0);light0.specular = new BABYLON.Color3(1, 1, 1); if you look through the source-code of the playground demo I linked above and go and find line 28: dirLight = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0.1, -1, 0), scene); this was the solution I was searching for hours, if you change that exact line to: dirLight = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0, -1, 0), scene); and then press 'RUN' again , you will notice that the shadow will no longer be visible. ...Am I overlooking something very basic or is this an actual issue? I am just learning Babylon, so please let me know if I made a stupid mistake Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 21, 2014 Share Posted October 21, 2014 You're not stupid at all and I should add some security system for that. When dealing with projection we cannot have a perfectly perpendicular vector because this leads to division by zero. You found by yourself the right solution. Congratz Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.