Jump to content

mattx264

Members
  • Posts

    16
  • Joined

  • Last visited

mattx264's Achievements

  1. BabylonCSG -> this is what i was looking for thank you very mach !
  2. I want to put inside wall mesh and see through it should make hole in the wall.
  3. @cureaalex, i tried alpha (before i posted) it doesn't work. Thank you. any other idea ?
  4. Hi everybody, Does any body know how to create mesh, something like Boolean modifier. It have to allow to see through walls. Thank you for help.
  5. Thank you @Deltakosh. I wrote this function, may be it will help somebody. var ArcAnimation = function (toAlpha, toBeta, toRadius,position) { var animCamAlpha = new BABYLON.Animation("animCam", "alpha", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysAlpha = []; keysAlpha.push({ frame: 0, value: camera.alpha }); keysAlpha.push({ frame: 100, value: toAlpha }); var animCamBeta = new BABYLON.Animation("animCam", "beta", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysBeta = []; keysBeta.push({ frame: 0, value: camera.beta }); keysBeta.push({ frame: 100, value: toBeta }); var animCamRadius = new BABYLON.Animation("animCam", "radius", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysRadius = []; keysRadius.push({ frame: 0, value: camera.radius }); keysRadius.push({ frame: 100, value: toRadius }); animCamAlpha.setKeys(keysAlpha); animCamBeta.setKeys(keysBeta); animCamRadius.setKeys(keysRadius); camera.animations.push(animCamAlpha); camera.animations.push(animCamBeta); camera.animations.push(animCamRadius); scene.beginAnimation(camera, 0, 100, false, 1, function () { }); }
  6. ok, Every think works great with free camera, but when i switched to ArcRotateCamera I'm getting error. var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 0, new BABYLON.Vector3(-0.5, 0.5, -1), scene); .. .. . animateCameraPositionAndRotation(camera, camera.position, new BABYLON.Vector3(16, 150, 15), camera.rotation, new BABYLON.Vector3(1.4922565104551517, -3.1539869787074517, 0)); });//////////////////////////////////////////////////// var animateCameraPositionAndRotation = function (freeCamera, fromPosition, toPosition, fromRotation, toRotation) { var animCamPosition = new BABYLON.Animation("animCam", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysPosition = []; keysPosition.push({ frame: 0, value: fromPosition }); keysPosition.push({ frame: 100, value: toPosition }); animCamPosition.setKeys(keysPosition); var animCamRotation = new BABYLON.Animation("animCam", "rotation", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysRotation = []; keysRotation.push({ frame: 0, value: fromRotation }); keysRotation.push({ frame: 100, value: toRotation }); animCamRotation.setKeys(keysRotation); freeCamera.animations.push(animCamPosition); freeCamera.animations.push(animCamRotation); scene.beginAnimation(freeCamera, 0, 100, false, 1, function () { camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 0, BABYLON.Vector3.Zero(), scene); }); }; ///////////////////// console error:Uncaught TypeError: Cannot read property 'x' of undefined babylon.1.9.0.js:1 BABYLON.Vector3.Lerpbabylon.1.9.0.js:1 BABYLON.Animation.vector3InterpolateFunctionbabylon.1.9.0.js:24 BABYLON.Animation._interpolatebabylon.1.9.0.js:24 BABYLON.Animation.animatebabylon.1.9.0.js:24 BABYLON._Animatable._animatebabylon.1.9.0.js:24 BABYLON.Scene._animatebabylon.1.9.0.js:1 BABYLON.Scene.renderbabylon.1.9.0.js:1 (anonymous function)index.js:37 BABYLON.Engine._renderLoopbabylon.1.9.0.js:1 (anonymous function)
  7. Hi, Is it way to add animation to camera. For example move forward 100px then rotate 90 deg to left. THANK YOU FOR ANY TIP
  8. I think @Temechon is right, - Merge your two scenes into one big scene : how can i do it ?, is it possible to do it in code ? thanks
  9. 1. I cut model because i could find easy way to make floors visible/hide. When import model to blender i got hundreds mesh, so i I decided to cut model. 2. When i load SINGLE model every think is OK, but i can not work with floors. "may be that the textures are missing." i don't get any error. Before I cut model in autocad i had try grouping and this is result http://tinypic.com/r/2np2tg/8 thank you for help
  10. $(document).ready(function () { if (!BABYLON.Engine.isSupported()) { alert("Your browser does not support WebGL so you can't use BabylonJS on it"); return; } var canvas = $("#renderCanvas")[0]; var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 0, BABYLON.Vector3.Zero(), scene); var light0 = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 1, 0), scene); camera.setPosition(new BABYLON.Vector3(-40, 40, 0)); camera.attachControl(canvas); var beforeRenderFunction = function () { // Camera if (camera.beta < 0.1) camera.beta = 0.1; else if (camera.beta > (Math.PI / 2) * 0.9) camera.beta = (Math.PI / 2) * 0.9; if (camera.radius > 200) camera.radius = 200; if (camera.radius < 5) camera.radius = 5; }; camera.attachControl(canvas); scene.registerBeforeRender(beforeRenderFunction); engine.runRenderLoop(function () { scene.render(); }); var skybox = BABYLON.Mesh.CreateBox("skyBox", 1000.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("../Content/skybox/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skybox.material = skyboxMaterial; var extraGround = BABYLON.Mesh.CreateGround("extraGround", 1000, 1000, 1, scene, false); var extraGroundMaterial = new BABYLON.StandardMaterial("extraGround", scene); extraGroundMaterial.diffuseTexture = new BABYLON.Texture("../Content/House/grass.jpg", scene); extraGroundMaterial.diffuseTexture.uScale = 60; extraGroundMaterial.diffuseTexture.vScale = 60; extraGround.position.y = -2.05; extraGround.material = extraGroundMaterial; //BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "05reszta.babylon", scene, function (newMeshes, particleSystems) { }); //BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "01piwnicabezmebli.babylon", scene, function (newMeshes, particleSystems) { }); //BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "02parterbezmebli.babylon", scene, function (newMeshes, particleSystems) { }); BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "03pietrobezmebli.babylon", scene, function (newMeshes, particleSystems) { }); //BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "04pietrobezmebli.babylon", scene, function (newMeshes, particleSystems) {}); BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "09reszta.babylon", scene, function (newMeshes, particleSystems) { }); });
  11. Hi, First I created house model in autocad and i cut it to pieces (every floor is one pieces) and exported to obj, next imported to blender and exported to babalon. when i loading one scen (one floor) texture are OK, but when i load next scene (next floor) texture mixing, every next scene makes more mixing. this is my loading code BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "09reszta.babylon", scene, function (newMeshes) {}); BABYLON.SceneLoader.ImportMesh("", "../Content/Home3d/", "03pietrobezmebli.babylon", scene, function (newMeshes) { }); Thank for help.
  12. so, how best to resolve it. Thank you for any help.
  13. I doesn't work, every cloned mesh have text="Eternalcoding9"
  14. My question is (I don't know why it doesn't show up), so mesh is cloning and i can set position for each cloned mesh, but i set texture for each different text it is the same for every. My question is how to clone texture. Thank you.
×
×
  • Create New...