• Content Count

  • Joined

  • Last visited

About babaorhum

  • Rank

Recent Profile Visitors

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

  1. thank you, on the playgroung, it's not to bad exept there is no more full screen button @jerome why is it bad on at the same time same smartphone here the code of the website ; window.addEventListener('DOMContentLoaded', function() { function toggleFullscreen(elem) { elem = elem || document.documentElement; if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullscreen) { elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } } else { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } } } document.getElementById('renderCanvas').addEventListener('click', function() { toggleFullscreen(); }); document.getElementById('renderCanvas').addEventListener('click', function() { toggleFullscreen(this); }); // get the canvas DOM element var canvas = document.getElementById('renderCanvas'); // load the 3D engine var engine = new BABYLON.Engine(canvas, true); //engine.switchFullscreen(true); var createScene = function() { // create a basic BJS Scene object var scene = new BABYLON.Scene(engine); scene.gravity = new BABYLON.Vector3(0, -9.82, 0); // create a FreeCamera, and set its position to (x:0, y:5, z:-20) var camera = new BABYLON.VRDeviceOrientationFreeCamera("camera1", new BABYLON.Vector3(0, 2, -20), scene); //var camera = new BABYLON.GamepadCamera("Camera", new BABYLON.Vector3(0, 3, -45), scene); camera.inputs.add(new BABYLON.FreeCameraGamepadInput()); camera.inputs.attached.gamepad.gamepadAngularSensibility = 250; camera.applyGravity = true; // target the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // attach the camera to the canvas camera.attachControl(canvas, true); camera.ellipsoid = new BABYLON.Vector3(3, 2, 3); scene.collisionsEnabled = true; camera.checkCollisions = true; //Fog scene.fogMode = BABYLON.Scene.FOGMODE_EXP; // scene.fogDensity = 0.09; scene.fogStart = 20.0; scene.fogEnd = 60.0; scene.fogColor = new BABYLON.Color3(0.9, 0.9, 0.85); // create a basic light, aiming 0,1,0 - meaning, to the sky // light1 var light = new BABYLON.PointLight("dir01", new BABYLON.Vector3(-250, -500, 250), scene); light.position = new BABYLON.Vector3(250, 500, -250); light.intensity = 1; // create a built-in "ground" shape; its constructor takes 5 params: name, width, height, subdivisions and scene var ground = BABYLON.Mesh.CreateGround('ground1', 1000, 1000, 2, scene); //Creation of a repeated textured material var groundMaterial = new BABYLON.StandardMaterial("ground", scene); groundMaterial.diffuseTexture = new BABYLON.Texture("assets/ground.jpg", scene); groundMaterial.diffuseTexture.uScale = 50; groundMaterial.diffuseTexture.vScale = 50; groundMaterial.specularColor = new BABYLON.Color3(0, 0, 0); ground.material = groundMaterial; // boxes material material = new BABYLON.StandardMaterial("kosh5", scene); material.diffuseColor = new BABYLON.Color3(0, 0, 0); material.reflectionTexture = new BABYLON.CubeTexture("assets/skybox", scene); material.reflectionTexture.level = 0.2; material.specularPower = 64; material.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1); //material.alpha = 0.95; // Fresnel //material.emissiveFresnelParameters = new BABYLON.FresnelParameters(); //material.emissiveFresnelParameters.bias = 1; //material.emissiveFresnelParameters.power = 2; //material.emissiveFresnelParameters.leftColor = BABYLON.Color3.Black(); //material.emissiveFresnelParameters.rightColor = BABYLON.Color3.White(); var boxParent = new BABYLON.MeshBuilder.CreateBox("box", 1, scene); boxParent.material = material; var meshPositionX = []; var meshPositionZ = []; for (var i = 0; i < 1000; i++) { var RandDom = function getRandomIntInclusive(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } var randomHeight = RandDom(20, 30); var PosX = RandDom(-500, 500); var PosZ = RandDom(-500, 500); var box = boxParent.createInstance("box: " + i); // change new mesh to cloning/instances to improve fps box.scaling = new BABYLON.Vector3(10, randomHeight, 10); var boxHeight = box.getBoundingInfo().boundingBox.extendSize.y; // get you the height box.position = new BABYLON.Vector3(PosX, boxHeight, PosZ); box.checkCollisions = true; meshPositionX.push(box.position.x); meshPositionZ.push(box.position.Z); }; boxParent.setEnabled(false); // hide the parent box // Skybox var skybox = BABYLON.Mesh.CreateBox("skyBox", 1000.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("assets/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); skyboxMaterial.disableLighting = true; skybox.material = skyboxMaterial; // Shadows //var shadowGenerator = new BABYLON.ShadowGenerator(1024, light); //shadowGenerator.getShadowMap().renderList.push(box); //shadowGenerator.useExponentialShadowMap = true; //ground.receiveShadows = true; //sounds var music1 = new BABYLON.Sound("", "sounds/tool.mp3", scene, null, { loop: true, autoplay: true, spatialSound: true, maxDistance : 300 }); music1.setPosition(new BABYLON.Vector3(PosX, 0, PosZ)); var laugh = new BABYLON.Sound("", "sounds/laugh.mp3", scene, null, { loop: true, autoplay: true }); laugh.setDirectionalCone(90, 180, 0); laugh.setLocalDirectionToMesh(new BABYLON.Vector3(1, 0, 0)); laugh.attachToMesh(boxParent); //finally, say which mesh will be collisionable ground.checkCollisions = true; skybox.checkCollisions = true; BABYLON.SceneOptimizer.OptimizeAsync(scene, BABYLON.SceneOptimizerOptions.HighDegradationAllowed()); return scene; } // call the createScene function var scene = createScene(); // run the render loop engine.runRenderLoop(function() { scene.render(); }); // the canvas/window resize event handler window.addEventListener('resize', function() { engine.resize(); }); }); thanks again we are stuck... have a nice day
  2. I'm trying the instances right now and changing either As I said I just change the playgroungd link I'll have a look on sps thanks @aWeirdo
  3. Hello Jerome, thank you for such a quick reply woudn't expect one until tomorrow I just edit the playground link as I think the other one may be wrong have a nice day
  4. Hello every babylonian, I'm coding for an afterwork a little game with babylonjs, with fog, vrdeviceorientationfreecamera, and some boxes, my mates and I have been looking for ways of explanation regarding our 12fps. from 250 units meshes to clones no improvement I adjust the number of clones to 250 instead of 1000 but biggers, no results I cut in half the size of the scene from 1000 to 500, nothing happend I commented the mirror material on the clones, nothing First we thought of having trees instead of theses boxes, but considering the fps number we are not sure about importing meshes or doing the tree generation thing as their is two meshes each times instead of one for us. The goal of the game is to find a rabbit somewhere, but it is already so low on our smatphone already that we kept on a small design. Perhaps we are all wrong or on the wrong way but you're not and you will have for sure great ideas to improve it and make it great we still want to add sounds coming from everywhere for the immersive experience with headset and VR glasses and a rabbit but first we need to fix the fps thing first, thank you for the help, the library, the fog whom looks awesome and your help again, btw new playgroung looks great, fullscreen a bit tricky at first on smartphone... thanks again, Jessica
  5. Well it seems I do BABYLON.SceneLoader.ImportMesh("", "Content/", "structura.babylon", scene, function (newMeshes) { var pipesLittleChimney = newMeshes[0]; var bigStructure = newMeshes[1]; var littleStructure = newMeshes[2]; var chimney = newMeshes[5]; var suflante = newMeshes[6]; // new Meshes match are found in console.log(newMeshes[i].name) }); Also I'm intrigued why one of my meshes keeps up side down but no way to have a look from it on sanbox even if I rotate it on 3DsMax If I want to link those meshes to lines and planes, I'll have to do inside the callback function? Thank you for your time
  6. It seams that all I can do is scaling rotating or position changing, anyway to get it call from outside that particular function? like a simple box, first you create it and then you call it in this PG, I cannot have a array of newMeshes in the console, or has it call outside the function or do I have to write everything I want this mesh to interact with into that specific function? Hope I'm clear, thx for your time, btw
  7. Hello every one, I'd love to know the end of this topic regarding how to pick a mesh from an imported one Here an example : Now imagine that I want it to a parent of something or bind to a canvas2D How do I do such thing? Thx again
  8. I was waiting for the official release with red carpet and champagne, but I give it a shot
  9. Thx guys, no more such error I had already such function going now it is the canvas2D that doesn't load anything and send errors works on playground, and if I comment the canvas2D snippet it works... any idea?
  10. It seems to me that it is actually the case isn't it?
  11. Hello everyone and thank you all for babylonjs according to this console : there is a bug both library are the same version 2.5 Can it explain blank canvas from visual studio? The NuggetManager only provide 2.3... babylonjs but canvas2D at all Kind regards, But I may be wrong of course
  12. Hello everyone, Working on GUI, HUD and canvas2D technologies at the moment I was wondering if dat.guiVR was on his way to be incremented to babylonJS? It allows to add a z axe onto it Thx
  13. Hello every one, I try to reproduce some feature from and here I am I cannot get my canvas2D to have some kind of billboardmode As you can see, I ended copy pasting most of the first playground properties into the second one with no result so far It seems that trackNodeBillboard expect a boolean according to babylonjs github but I may be wrong parenting the canvas2d to sphereM (biggerbox) does not follow the move, I don't know what I'm doing wrong Thanks to all of you
  14. Txs Wingnut but absolute css isn't what I'm looking for I explain : I want to do something like that as you can see when you zoom to the scene, the big box disappeared, showing smaller ones, A kind of panel like here I'd like to attach a panel to each one, like here, that whould show some json, and would appears only from the little boxes when these are visibled Voila A lot of work yet in poo (I mean POO of course ) of course ...! a long way Jessica