ilearnwebgl Posted January 25, 2015 Share Posted January 25, 2015 Hi, I'm new to programming and trying to learn webGL using the playground on babylon js. The site is really good and seem to help me with learning about babylon js and webGL. I'm trying to modify camera target:camera.setTarget(BABYLON.Vector3.Zero()); to some other coordinate, for e.g. camera.setTarget(BABYLON.Vector3.(0, 0.2, 0)); This doesn't seem to work. Any ideas? I tried to search for some documentation that gives some examples on the various syntaxies but couldn't find any for a beginner level. Thanks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 25, 2015 Share Posted January 25, 2015 Hello can you repro your problem on the playground? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 25, 2015 Share Posted January 25, 2015 Here's how to solve your problem : camera.setTarget (new BABYLON.Vector3 . (0, 0,2, 0) ); // add "new" and delete "." Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 25, 2015 Share Posted January 25, 2015 Small correction, Zero is still a function even thou it is static. so, the correct way will be BABYLON.Vector3.Zero() . Just using Zero will return the function that creates the zero vector. The missing "new" is (probably) the reason why it is not working. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 25, 2015 Share Posted January 25, 2015 Yes, Stupid error .I do not know what I was thinking. I correct my post. Do not also forget the "." Vector3 after that will generate an error. Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 25, 2015 Share Posted January 25, 2015 ilearnwebgl, if you haven't seen this, tutorials are located here: https://github.com/BabylonJS/Babylon.js/wiki/00-Babylon.js-Primer Also the Playground is a really good place to learn a lot of the main functionality of BabylonJS: http://www.babylonjs-playground.com/ Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 25, 2015 Share Posted January 25, 2015 The right link: http://doc.babylonjs.com/page.php?p=22621 amorgan 1 Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 26, 2015 Share Posted January 26, 2015 Sorry, there still seems to be some gaps with the new migration from Wiki to the docs Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 26, 2015 Share Posted January 26, 2015 Yes I know some bugs remaining. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 28, 2015 Share Posted January 28, 2015 Mostly, there is lots of link-updating that Wingnut is slow at doing. I have been SO LAZY lately. ILearnWebGL... you still alive? I hope the guys fixed you up. Keep us posted on your projects and experiments. We love hearing about them, even if basic/beginner. 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.