Kemal UÇAR Posted June 10, 2016 Share Posted June 10, 2016 Hi all I m newbie on Babylon since 2 days from Turkiye ; I created a scene on 3dsmax and exported to babylon file format scene working good on browser with textures (firefox) then added a arcrotate camera is good added some lines and i can scale rotate etc lines worked : now its a problem for me ; i want manuplate a mesh in imported babylon file for scale rotate or move or change texture i can see mesh name on mesh tree, when i add this line on script file mymeshname.rotation.y = Math.PI / 6; scene cant load on browser :((( How to select mesh in babylon file ?? and change scale rotation texture etc. please help me its html file working <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Babylon imported max</title> <!-- Babylon.js --> <script src="./JS/babylon.2.3.js"></script> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "kek.babylon", engine, function (Scene) { Scene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 50, BABYLON.Vector3(0,0,0), Scene); Scene.activeCamera = camera; camera.attachControl(canvas, true); camera.setPosition(new BABYLON.Vector3(0,2000,-3000)); camera.lowerBetaLimit = 0.1; camera.upperBetaLimit = (Math.PI / 2) * 0.9; Scene.debugLayer.show(); var lines = BABYLON.Mesh.CreateLines("lines", [ new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(1000, 1000, 500) ], Scene); // PROBLEM HERE ??? ****************************************************** "kaldirim" is my mesh name in babylon file *********** // kaldirim.rotation.y = Math.PI / 6; // PROBLEM HERE ??? ********************** engine.runRenderLoop(function() { Scene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); } </script> </body> </html> Thanks all Quote Link to comment Share on other sites More sharing options...
Kemal UÇAR Posted June 10, 2016 Author Share Posted June 10, 2016 Hi All I solved this problem just added this var definition : var newKaldirim = Scene.getMeshByName("kaldirim"); newKaldirim.rotation.y = Math.PI / 6; then worked well i found this way in forum topics thank you very much JCPalmer Happy with BabylonJS woot!! GameMonetize and JCPalmer 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 11, 2016 Share Posted June 11, 2016 Off to a good start answering your own question Kemal UÇAR 1 Quote Link to comment Share on other sites More sharing options...
Kemal UÇAR Posted June 12, 2016 Author Share Posted June 12, 2016 I like diggin ; Thank you again. 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.