freetoplay

Members
  • Content count

    20
  • Joined

  • Last visited

  1. freetoplay

    Babylon Viewer Issue

    I ended up using model.normalize="true"
  2. freetoplay

    Rotating Mesh Around Y Axis using lookAt

    @Magilla Actually, it works like I expected, I just had to increase the speed from 0.01 😀. Quick question though, what would be the best way to make the rotation more smooth? Like now it looks kind like it's lagging. Thanks for all the help!
  3. freetoplay

    Rotating Mesh Around Y Axis using lookAt

    @Magilla Wow yes, that's almost exactly what I need! The only problem now is I want the duck to face the mouse (right now it seems to be facing the opposite direction from the mouse) and be able to do a 360 degree rotation? Do you know how I can do that?
  4. freetoplay

    Babylon Viewer Issue

    @RaananW That works as expected! Thanks!
  5. freetoplay

    Rotating Mesh Around Y Axis using lookAt

    I tried using scene.pointerY and scene.pointerX, but it doesn't seem to work for me. Here is my current code for the playground, along with comments on where I am running into issues: https://www.babylonjs-playground.com/#9IN03D#6 Is the lookAt function the right function to use in this case?
  6. Is lookAt the best function for rotating the mesh around the Y access based on the location of the mouse pointer? My code currently looks something like this: let rotateMesh = function(evt) { let vec3 = new BABYLON.Vector3(0, evt.clientX, 0); mesh.lookAt(vec3); } The problem is that it throws the mesh out of position. How would I rotate it around only the Y position, while keeping the X and Z coordinates the same? If using the lookAt function is not the best approach, what would be a better approach?
  7. freetoplay

    Getting the camera to center on model

    Doesn't seem to work for me. This is what my code looks like: var createScene = function () { // create a basic BJS Scene object var scene = new BABYLON.Scene(engine); // loader var loader = new BABYLON.AssetsManager(scene); // light var light0 = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 0, 0), scene); light0.specular = new BABYLON.Color3(0, 0, 0); // cam // Parameters : name, position, scene var camera = new BABYLON.UniversalCamera("UniversalCamera", new BABYLON.Vector3(0, 0, 10), scene); // Targets the camera to a particular position. In this case the scene origin camera.setTarget(BABYLON.Vector3.Zero()); // Attach the camera to the canvas camera.attachControl(canvas, true); var model = loader.addMeshTask("box", "", "./", "character.glb"); loader.onFinish = function(task) { camera.setTarget(task[0].loadedMeshes[0].position); engine.runRenderLoop(function () { scene.render(); }); }; loader.load(); return scene; };
  8. How can I get the camera to "center" (not sure if center is the right word here) directly on the model like the Babylon Sandbox does when you drop in the file? Any help would be greatly appreciated.
  9. freetoplay

    Babylon Viewer Issue

    Hi, I am playing around with the Viewer, but when I load models, everything appears really zoomed in. I am using this code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>BabylonJS Viewer - Basic usage</title> <style> babylon { width: 100%; height: 600px; } </style> </head> <body> <babylon model="./character.glb"></babylon> <script src="https://viewer.babylonjs.com/viewer.min.js"></script> </body> </html> Do I have to manually adjust the camera to zoom out?
  10. freetoplay

    Support for double sided mesh?

    Disabling backface culling closes the holes inside of the mesh, but I still have an issue with random holes outside of the mesh, does anyone know of a possible solution for this?
  11. I tested a gltf model in the babylon sandbox that does not appear to be rendering double sided mesh (it's poking holes in the mesh). Is there a way to get around this issue?
  12. freetoplay

    Issue viewing gltf file on babylon sandbox

    Can I PM you the files?
  13. freetoplay

    Issue viewing gltf file on babylon sandbox

    Drag and drop didn't work for me, but the file upload worked as long as I unchecked the Ambient Texture box.
  14. freetoplay

    Issue viewing gltf file on babylon sandbox

    Yep, but I keep getting the error. I also tried it the file upload way, but then the model loads, but the texture fails to display anything. Update: It works if I go to the display inspector and uncheck Ambient Texture.
  15. I am getting this error when trying to import the folder: #/buffers/0: Failed to load 'file_name.bin': 0 Is there a way to figure what the exact error is? The model that I am importing on the three.js viewer, but not the babylon sandbox.