boris Posted May 17, 2017 Share Posted May 17, 2017 Hi guys. i got 2 little questions that are bothering me: 1. im importing an .obj model with assetManager, and onSuccess im trying to iterate through all of the models meshs and change their material texture's to a new texture. but i just does nothing. http://www.babylonjs-playground.com/#2GVUDN . BUT, if i save the loaded model and create a function that runs after about 15 seconds that tries to do create new textures for all the meshes it does it succefully. what am i missing here? 2. in that same link, how can i prevent the arc camera from going below the house? that means keep it always above 0 (y>0) thanks. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 17, 2017 Share Posted May 17, 2017 @boris; Hi boris, welcome to the forum For controlling the ArcRotate camera you can use this kind of code: myScene.registerBeforeRender(function () { if (myCamera.beta < .75) myCamera.beta = .75; else if (myCamera.beta > (Math.PI / 2) * 0.66) myCamera.beta = (Math.PI / 2) * 0.66; }); I got the code originally from something @Dad72 posted.. Play around with the beta values to meet your needs. I have no experience with loading .obj files directly - but others can help I'm sure. cheers, gryff Dad72 1 Quote Link to comment Share on other sites More sharing options...
boris Posted May 17, 2017 Author Share Posted May 17, 2017 thanks @gryff ! i will try that immediately. btw, about the first question it goes the same with .babylon objects. i tried both of them, usually i work with .obj so that what was in example 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.