Pawel W

  • Content Count

  • Joined

  • Last visited

Everything posted by Pawel W

  1. Hello there, if anyone needs rotating 3D objects in both directions, here it is:
  2. To those who would like babylon to stop calling for manifest - modify Database.prototype.checkManifestFile function, so it starts like this: Database.prototype.checkManifestFile = function () { var _this = this; var that = this; function noManifestFile() { that.enableSceneOffline = false; that.enableTexturesOffline = false; that.callbackManifestChecked(false); } noManifestFile(); // those 2 lines disable calling for Manifest return; // those 2 lines disable calling for ManifestDidn't look what those functions inside noManifestFile() do, but they were called after failure of downloading manifest - so I put them before this call happens and do the return. I understand manifest file is somehow used for caching, but should't it be rather deifned by some param? I really don't get this external-file-approach
  3. Thank you, took me a while to edit this uv map (also, had to rotate it), but it got the work done!
  4. Hello there, I'm trying to create placeholder editor (svg), where users can edit photo on the left and they get 3d preview of it on the right. So far so good, but I'm having problems with texturing mesh. Here is a screen how it looks: Model I use: And function how I update texture: //get texture url and create material: var textureUrl = "http://localhost/FotoEditor/app/php/" + response +"?"+new Date().getTime(); var materialTest = new BABYLON.StandardMaterial("texture", $scope.babylon.sceneVars.scene); materialTest.diffuseTexture = new BABYLON.Texture(textureUrl, $scope.babylon.sceneVars.scene); //scale it somehow, dont know is it good or not, but without it texture is strongly zoomed: materialTest.diffuseTexture.uScale = 5; materialTest.diffuseTexture.vScale = 5; //assign material to mesh: $scope.babylon.sceneVars.scene.meshes[0].material = materialTest; Issues: 1. Why is texture initially rotated? Object is in 0,0,0 position and it's not turned around... 2. Is there any way I can make sure proportions from what user create on the left are exact on 3d model? In SVG users create in editor on the left I have all dimensions I need, but I'm not sure how can i connect them with those on 3d model (model is created in blender with metrics dimensions) 3. How can I turn off texture repetition? If user pan out image it should not repeat on 3d object and leave white space instead.
  5. Thank you! I've put camera inside blender reallly close (almost covers the object), then set object's position to 0,0,0 rendered object and it worked! I also had to change wheel precision and angular sensibility to fit small object. For those who get similar problems, here is my babylon camera params: var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 0.2, new BABYLON.Vector3(0, 0, 0), newScene);camera.angularSensibility = 700;camera.wheelPrecision = 300; Now cup is rendered properly and has real world dimensions I'm having some problems with texturing mesh, but that is another subject I guess.Thanks again!
  6. Hello, Can someone please help me with setting correct model/scene for small scale object from Blender? I'm trying to create 3d-product preview for image html5 image editor (the idea is so user can edit canvas on the left, and it gets updated on the right babylon 3d scene, and the products must be real world size). The problem is that imported scene is realy small - object is very tiny, and zooming it creates too much movement Object is just a simple cup and is ~ 15cm x 9 cm x 9cm. You can check it - here is blender model: Function I use to display scene: BABYLON.SceneLoader.Load("", "images/CUP/source/cup.babylon", this.sceneVars.engine, function (newScene) { newScene.executeWhenReady(function () { $scope.babylon.sceneVars.scene = newScene; var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 1, new BABYLON.Vector3(0, 1, 0), newScene); newScene.activeCamera = camera; newScene.activeCamera.attachControl($scope.babylon.sceneVars.canvas); newScene.clearColor = new BABYLON.Color4(1,0,0,0); $scope.babylon.sceneVars.engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { }); Is there something wrong with camera position, or maybe with blender model?