Arktius

Members
  • Content Count

    24
  • Joined

  • Last visited

About Arktius

  • Rank
    Member

Profile Information

  • Location
    Antarctica

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. If you want to alter all meshes from any file, you will use it. =) Edit: The important code was the loop, not console.log()
  2. Hey guys, the canvas is a small part of my website. <canvas id="canvas" style="position: absolute; width: 80%; height: 80%; touch-action:none; "></canvas> How can I set the range from my joystick camera? It recognize the camera in the whole website.
  3. console.log(scene.meshes); var i = ; while (scene.meshes[i] != null) { console.log("Mesh[" + i.toString() + "]" + scene.meshes[i].name); //alert(scene.meshes[i].name); Messagebox i++; } This shows all the names of meshes. I don't know if a counter exists. The Output is in the console from Browser. (press F12 and look in console)
  4. I used the wrong Meshname . Thanks for advise. But how can I find the Meshnames from a file / are loaded in scene in code? I don't want to add every single Meshname from every file I want to import.
  5. Try this: //shows scene BABYLON.SceneLoader.ImportMesh("", "https://raw.githubusercontent.com/gson78/miscWebGLpages/gh-pages/blender-scenes/", "custom-speakers2.babylon", scene); BABYLON.MeshBuilder.CreateTorus("torus", {thickness: 0.2}, scene); var speaker1 = scene.getMeshByName("torus"); speaker1.position.y = 4; speaker1.position.x = 1;
  6. var model = BABYLON.SceneLoader.Load(document.getElementById("pfad").value, document.getElementById("name").value, engine, function (scene) { scene.executeWhenReady(function () { scene.getMeshByName(document.getElementById("name").value).position.y = 8; scene.registerBeforeRender(function () { //Code... }); }); // Render engine.runRenderLoop(function () { scene.render(); }); // Resize window.addEventListener("resize", function () { engine.resize(); }); }); // Babylon loader I get the message,that getMeshByName(...) ISNULL. Same error with .getMeshByID(0) ,(1) or if I move the Code after the SceneLoader. :-/
  7. Hey guys, I want to edit the loading Object in the following code. I want to rotate it or to set the vertices and normals. I tried it with "this" . BABYLON.SceneLoader.Load(document.getElementById("path").value, document.getElementById("name").value, engine, function (scene) { // Ground var ground = BABYLON.Mesh.CreateGround("ground", 15,15, 1, scene, false); var groundMaterial = new BABYLON.StandardMaterial("ground", scene); groundMaterial.specularColor = BABYLON.Color3.Black(); ground.material = groundMaterial; //ground.rotation.x += Math.PI/2 ; //ground.rotation.y += Math.PI/2 ; // Light var light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(, 1, ), scene); //newScene light1.intensity = 0.4 ; var cam = new BABYLON.VirtualJoysticksCamera("VJC",new BABYLON.Vector3(, 4, -10) , scene); //Attach a camera to the scene and the canvas scene.activeCamera = cam; cam.attachControl(canvas, false); //this.rotation.y -= 35;<---- ? // Render engine.runRenderLoop(function () { scene.render(); }); // Resize window.addEventListener("resize", function () { engine.resize(); }); }); // Babylon loader
  8. With Hand.js and touch-action: none; everything is fine =) I used a JoystickCamera: <canvas id="canvas" style="position: absolute; width: 80%; height: 80%; touch-action:none; "></canvas> ... var cam = new BABYLON.VirtualJoysticksCamera("VJC",new BABYLON.Vector3(, 4, -10) , scene); // Rotationspeed cam.angularSensibility = 10000; // 2000 // Output Browser console console.log(cam.angularSensibility); //Attach a camera to the scene and the canvas scene.activeCamera = cam; cam.attachControl(canvas, false);
  9. The Problem is to rotate the sphere, to see the back side. + If I add some HTML Elements like Textareas or Buttons, the camera does nothing.(just show the sphere, not more)
  10. Hey guys, I want to navigate the camera with the touch features from smartphone/tablet. Neither ArcRotate,Free or Touch-Camera works. Is Hand.js necessary? <!doctype html> <html> <head> <meta charset="utf-8"> <title>Babylon - Basic scene</title> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> <script type="text/javascript" src="http://cdn.babylonjs.com/2-3/babylon.js"></script> <script type="text/javascript" src="./hand.js"></script> </head> <body> <canvas id="renderCanvas"></canvas> <script type="text/javascript"> // Get the canvas element from our HTML below var canvas = document.querySelector("#renderCanvas"); // Load the BABYLON 3D engine var engine = new BABYLON.Engine(canvas, true); // ------------------------------------------------------------- // Here begins a function that we will 'call' just after it's built var createScene = function () { // Now create a basic Babylon Scene object var scene = new BABYLON.Scene(engine); // Change the scene background color to green. scene.clearColor = new BABYLON.Color3(0, 1, 0); // This creates and positions a free camera var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); // This targets the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // This attaches the camera to the canvas camera.attachControl(canvas, false); // This creates a light, aiming 0,1,0 - to the sky. var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); // Dim the light a small amount light.intensity = .5; // Let's try our built-in 'sphere' shape. Params: name, subdivisions, size, scene var sphere = BABYLON.Mesh.CreateSphere("sphere1", 10, 1, scene); // Move the sphere upward 1/2 its height sphere.position.y = 1; // Let's try our built-in 'ground' shape. Params: name, width, depth, subdivisions, scene var ground = BABYLON.Mesh.CreateGround("ground1", 3, 3, 2, scene); // Leave this function return scene; }; // End of createScene function // ------------------------------------------------------------- // Now, call the createScene function that you just finished creating var scene = createScene(); // Register a render loop to repeatedly render the scene engine.runRenderLoop(function () { scene.render(); }); // Watch for browser/canvas resize events window.addEventListener("resize", function () { engine.resize(); }); </script> </body> </html>
  11. Now the Website is in the same folder like the obj/stl files (in htdocs from Xampp) and I need to use my IP to load the website but it works =) Thanks for your help guys !
  12. I am using XAMPP v3.2.2.
  13. Import ship.stl in Blender, Export in ASCII ( lower left corner ) Thanks RaananW ! =) What about the Camera(Babylon/STL) / Wireframe(OBJ) ? Opera and IE don't work with a local STL-file. Firefox works. All 3 Browsers don't work with a local OBJ-file. ship2.stl
  14. Thanks for your help! Is there an alternative way without disable CORS ?(Disable CORS Internet Explorer) And how to show the Wireframe? Edit: I cant rotate the Object/rotate the camera with the Code from amorgan if i load a babylon file. Why?
  15. Sure! airboat.obj monkey.babylon ship.stl