BritneyWatch

Members
  • Content Count

    10
  • Joined

  • Last visited

About BritneyWatch

  • Rank
    Member

Recent Profile Visitors

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

  1. The scene have no camera, just the character, nothing but the character. Some parts of the character is skinned/rigged, other more rigid parts that doesn't deform [because it's not flesh] are parented directly to the bone. This is the error reported by BabylonJS's Blender exporter: File "json_exporter.py", line 107, in execute mesh = Mesh(object, scene, self) File "mesh.py", line 165, in __init__ bakedMat = BakedMaterial(exporter, object, recipe) File "material.py", line 499, in __init__ self.bake('bumpTexture', 'NORMAL', 'NORMALS', image, mesh, uvName, exporter, recipe) File "material.py", line 519, in bake self.bakeCycles(cycles_type, image, uvName, recipe.nodeTrees, extension) File "material.py", line 570, in bakeCycles tree.nodes.remove(tree.nodes.active) ERROR: Nodes.remove(): error with argument 1, "node" - Function.node does not support a 'None' assignment Node type The version used is Blender 2.79b.
  2. THANK YOU ! So Is this note of mine accurate ? Sphere1.scaling = new BABYLON.Vector3(1,5,1); //As you can tell 1 = 100%. //or you can manually Sphere1.scaling.y = 5;
  3. Sphere1.scaling = new BABYLON.Vector3(0, 5, 0); doesn't work but Sphere1.scaling.y = 5; works why ?
  4. <!DOCTYPE html> <html> <head> <meta charset = "UTF-8"> <title>Babylon.js Bare Minimum Setup</title> <style type="text/css"> html, body { margin:0; padding:0; width:100%; height:100%; overflow:hidden; background-color: #000000; } #my_canvas { width:100%; height:100%; touch-action:none; } </style> <script src="babylon.js"></script> <script> var canvas_id; var engine; var scene; var camera; var light; var sphere; function init() { setup_Babylon_Scene(); addEventListener("keydown", onKeyDown, false); } function onKeyDown(event) { scene.getMeshByName("Sphere1").position.z += 0.1; } function setup_Babylon_Scene() { canvas_id = document.getElementById("my_canvas"); engine = new BABYLON.Engine(canvas_id); scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3.White(); light = new BABYLON.PointLight("Light1", new BABYLON.Vector3(0,30,10),scene); sphere = BABYLON.Mesh.CreateSphere("Sphere1",16,6,scene); //Segments, Radius; var mat = new BABYLON.StandardMaterial("Material1", scene); mat.diffuseTexture = new BABYLON.Texture("Diffuse.png", scene); sphere.material = mat; var sphere1 = BABYLON.Mesh.CreateSphere("Sphere2",16,6,scene); var mat2 = new BABYLON.StandardMaterial("WireMaterial1", scene); mat2.wireframe = true; sphere1.material = mat2; sphere1.position.x = 10; camera = new BABYLON.FollowCamera("FollowCamera1",BABYLON.Vector3.Zero(), scene); camera.lockedTarget = sphere; camera.radius = 10; camera.heightOffset = 10; camera.attachControl(canvas_id); //Default controls enabled. engine.runRenderLoop(onEnterFrame); window.addEventListener("resize",function(){engine.resize();}); } function onEnterFrame() { scene.render(); } </script> </head> <body onLoad="init()"> <canvas id="my_canvas"></canvas> </body> </html> That last line "camera.attachControl(canvas_id);" , whether I add it in or not, it makes no difference, the mouse have no effect on it whatsoever. Works for ArcRotateCamera and Free Camera but not FollowCamera, should I even bother to put in that last line for FollowCamera at all or is it a bug ?
  5. I understand that in Babylon.js, you have to put lights for shadings and well....3D effect in general. But say I want to save up all the processing time and do away with having to calculate lights altogether and I already have my scene with all the lighting information baked in the texture. In Blender such a texture would be called emissive, in 3DS Max, it will be standard material with full illumination. How or what is the way to implement such a simplistic texture in Babylon.js to save up lighting calculation time ?
  6. BritneyWatch

    How to change Babylon.js's default canvas size ?

    Thank you to the both of you @Dad72 and @Sebavan ! It is now filling up the whole inner width and height. But then another issue, if I were to resize the window, the 3D sphere gets distorted...how do I make sure everything is not distorted ? I rather everything scale to fit then being distorted.
  7. BritneyWatch

    How to change Babylon.js's default canvas size ?

    Hello @Sebavan, thank you for trying to help You know like when you expand your window or maximize it, BabylonJS have like blank space on the bottom ? Hence BabylonJS do have an inherent screen ratio, how to change it ?
  8. This is the base code, as simple as it could possibly be: <!DOCTYPE html> <html> <head> <meta charset = "UTF-8"> <title>Babylon.js Bare Minimum Setup</title> <style type="text/css"> <!-- You NEED these styles --> html, body { margin:0; padding:0; width:100%; height:100%; overflow:hidden; background-color: #000000; } #my_canvas { width:100%; height:100%; touch-action:none; } </style> <script src="pep.js"></script> <script src="babylon.js"></script> <script> var canvas_id; var engine; var scene; var camera; var light; var sphere; var ground; function init() { if (BABYLON.Engine.isSupported()) { console.log("Babylon.js is supported !"); setup_Babylon_Scene(); } else { console.log("Babylon.js is not supported :-("); } } function setup_Babylon_Scene() { canvas_id = document.getElementById("my_canvas"); engine = new BABYLON.Engine(canvas_id, true); scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3(0,0,0); //Background Color. camera = new BABYLON.FreeCamera("Camera1", new BABYLON.Vector3( 0, 6, -15),scene); camera.setTarget(BABYLON.Vector3.Zero()); camera.attachControl(canvas_id,true); light = new BABYLON.HemisphericLight("HemiLight1",new BABYLON.Vector3(0,1,0), scene); light.groundColor = new BABYLON.Color3(1,0,0); light.intensity = 0.8; sphere = BABYLON.Mesh.CreateSphere("Sphere1",16,2,scene); sphere.showBoundingBox = true; sphere.position.y = 1; var material = new BABYLON.StandardMaterial("standardMaterial1", scene); material.diffuseColor = new BABYLON.Color3(0.3,0.2,1); sphere.material = material; ground = BABYLON.Mesh.CreateGround("Ground1",6,6,2,scene); engine.runRenderLoop(function(){scene.render();}); window.addEventListener("resize", function(){engine.resize();}); } </script> </head> <body onLoad="init()"> <canvas id="my_canvas"></canvas> </body> </html> If you just copy and paste this in, you will see that this canvas defaults to a 16:9 ratio leaving the bottom of the browser white and blank EVENTHOUGH I already set the background-color of my body to black through CSS which is very strange. How do I change the ratio of babylon's default screensize to say may 4:3 aspect ratio ? And how do I actually make the rest of my page black ? Thanks.