Dad72 Posted September 19, 2014 Share Posted September 19, 2014 Try: var LightDirectional = [];LightDirectional[0] = new BABYLON.DirectionalLight("Sun", new BABYLON.Vector3(-1, -5, -1), scene, true); LightDirectional[0].diffuse = new BABYLON.Color3(0.80, 0.80, 0.80); LightDirectional[0].specular = new BABYLON.Color3(0, 0, 0); LightDirectional[0].intensity = 0.8;LightDirectional[1] = new BABYLON.DirectionalLight("Sun", new BABYLON.Vector3(0.2, 0.1, 0.2), scene, true); LightDirectional[1].diffuse = new BABYLON.Color3(0.80, 0.80, 0.80); LightDirectional[1].specular = new BABYLON.Color3(0, 0, 0); LightDirectional[1].intensity = 0.8;PointLight plans no shadows Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 19, 2014 Author Share Posted September 19, 2014 Thanks Dad72, still the same problem, below is a screenshot.... Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 19, 2014 Author Share Posted September 19, 2014 I added my scene in the playground, but i don't know where i can load my tree.babylon file to make it useable in the playground. http://www.babylonjs.com/playground/#WBVYZ#8 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2014 Share Posted September 19, 2014 Could you try to set the position of your light to the position of your camera (jsut to be sure this is not due to some issues with the position of your light). Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 19, 2014 Author Share Posted September 19, 2014 I have changed the code like this :/* Build camera */var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 2, 0), scene);scene.activeCamera = camera;camera.applyGravity = true;camera.checkCollisions = true;camera.speed = 1;camera.attachControl(canvas, false);camera.keysUp.push(90);camera.keysLeft.push(81);camera.keysRight.push(68);camera.keysDown.push(83);/* Build sun light */var LightDirectional = [];LightDirectional[0] = new BABYLON.DirectionalLight("Sun", new BABYLON.Vector3(0, 2, 20), scene, true); LightDirectional[0].diffuse = new BABYLON.Color3(0.80, 0.80, 0.80); LightDirectional[0].specular = new BABYLON.Color3(0, 0, 0); LightDirectional[0].intensity = 5;So my camera is set to : X : 0, Y : 2, Z : 0 I load my tree at : X : 0, Y : 0, Z : 20 My light "look" at X : 0, Y : 2, Z : 20 So, now the tree get light but the ground don't ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2014 Share Posted September 19, 2014 Can you share your scene somewhere? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2014 Share Posted September 19, 2014 And try with this direction : new BABYLON.Vector3(0, -2, 20) Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 19, 2014 Author Share Posted September 19, 2014 With the new direction it works. But there is a point i'm missing, a direction it's a start and a end so i need X,Y,Z for the start point and X,Y,Z for the end point, obviously this is not the case here can you explain to me what mean exactly new BABYLON.Vector3(0, -2, 20)? You can access my scene here : http://www.sociusrocket.com Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 19, 2014 Share Posted September 19, 2014 new BABYLON.Vector3(0, -2, 20) These are directions and not the positions. To position your light you use LightDirectional[0].position = BABYLON.Vector3(0, 20, 20); Quote Link to comment Share on other sites More sharing options...
Adrian Posted September 20, 2014 Author Share Posted September 20, 2014 I understand. So The position could be considered like the start position then the direction is the point which is looked by the le light. By default, the position is 0, 0, 0 ? EDIT : I misunderstood, in the doc it is said that the light comes from the infinite, in the direction define by the vector. but the infinite come from where ?? in a 3D world the infinite can come from anywhere ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2014 Share Posted September 23, 2014 From the infinite to the infinite 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.