Search the Community
Showing results for tags 'colour'.
-
I maked simple hexagon in blender and i want change colour on click button "Click me". How I can refer to the specific id (In this case - Cube) from blender in my script? Can you check my html file? I'm not sure that all it's good. It's blender file {"producer":{"name":"Blender","version":"2.78 (sub 0)","exporter_version":"4.6.1","file":"szescian.babylon"}, "autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0], "materials":[{"name":"szescian.Material","id":"szescian.Material","ambient":[0.8,0.7048,0.0663],"diffuse":[0.64,0.5639,0.0531],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true,"checkReadyOnlyOnce":false}], "multiMaterials":[], "skeletons":[], "meshes":[{"name":"Plane","id":"Plane","billboardMode":0,"position":[0.2658,0.2489,1.9542],"rotation":[0,0,0],"scaling":[5,5,5],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false ,"positions":[1,0,-1,-1,0,1,-1,0,-1,1,0,1] ,"normals":[0,1,0,0,1,0,0,1,0,0,1,0] ,"indices":[0,1,2,0,3,1] ,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":4,"indexStart":0,"indexCount":6}] ,"instances":[]} ,{"name":"Cube","id":"Cube","materialId":"szescian.Material","billboardMode":0,"position":[0,1,0],"rotation":[0,0,0],"scaling":[1,1,1],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false ,"positions":[1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,1,-1,1,1,1,-1,-1,-1,-1,1,-1] ,"normals":[0.5773,-0.5773,-0.5773,-0.5773,-0.5773,0.5773,0.5773,-0.5773,0.5773,-0.5773,0.5773,0.5773,0.5773,0.5773,-0.5773,0.5773,0.5773,0.5773,-0.5773,-0.5773,-0.5773,-0.5773,0.5773,-0.5773] ,"indices":[0,1,2,3,4,5,5,0,2,4,6,0,6,3,1,2,3,5,0,6,1,3,7,4,5,4,0,4,7,6,6,7,3,2,1,3] ,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":8,"indexStart":0,"indexCount":36}] ,"instances":[]} ], "cameras":[{"name":"Camera","id":"Camera","position":[7.4811,5.3437,-6.5076],"rotation":[0.4615,-0.8149,0],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"cameraRigMode":0,"interaxial_distance":0.0637,"type":"FreeCamera"}],"activeCamera":"Camera", "lights":[{"name":"Lamp","id":"Lamp","type":0,"position":[4.0762,5.9039,1.0055],"intensity":8.22,"diffuse":[0.1138,1,0.1492],"specular":[0.1138,1,0.1492]}], "shadowGenerators":[] } My html code <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> <title>Babylon - Getting Started</title> <!-- link to the last version of babylon --> <script src="js/babylon.2.5.js"></script> <link rel="stylesheet" href="css/style.css"> </head> <body> <canvas id="renderCanvas"></canvas> <button id="sweetButton">Click me</button> <script> window.addEventListener('DOMContentLoaded', function(){ var canvas = document.getElementById('renderCanvas'); var engine = new BABYLON.Engine(canvas, true); engine.enableOfflineSupport = false; var createScene = function(){ var scene = new BABYLON.Scene(engine); // create a FreeCamera, and set its position to (x:0, y:5, z:-10) var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5,-10), scene); // target the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // attach the camera to the canvas camera.attachControl(canvas, false); // create a basic light, aiming 0,1,0 - meaning, to the sky var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene); BABYLON.SceneLoader.ImportMesh("","","szescian.babylon",scene); return scene; } var scene = createScene(); engine.runRenderLoop(function(){ scene.render(); }); window.addEventListener('resize', function() { engine.resize(); }); }); </script> </body> </html>
-
Hi all, Is this possible? e.g. // Create textvar t = this.game.add.text(10, 10, "Hello World", { font: "16pt Arial", fill: "#FFFFFF", align: "center" });// Ideally not this because it uses internal values, and actually doesn't update the text displayed. t._style['fill'] = "#FF0000";// Perhaps something like this...!t.updateCSS({ font: "16pt Arial", fill: "#FF0000", align: "center" });Thanks!
-
Hi Guys, I am working with a custom model and I am attaching child meshes to it. I am trying to rectify a problem that I am having when I add colour to the model. I lose the 3d shape, the child meshes look flat and you cant differentiate between them When I remove the colour in the material, in greyscale it looks fine. see attached pictures for comparison. Also Multi Material doesnt seem to be working as expected. The next issue I am having is the orientation of the "base modal". When I init the script its rendering the base in an angle vs being upright, as per picture. If I apply a transformation to it, it does something funky to the rest of the world co-ord mapping and everything else breaks afterwards. I am new to this and in 3d programming in general. Any insights to help me solve these 2 issues would be helpful. My code can be found on http://www.babylonjs-playground.com/#15O3MB#1
-
Hi All, Just finished a new game, Colour Match is a simple colour matching arcade game,built using PhaserJS. The game is simple, change the tile colour to match with the falling square. Suggestions and comments are welcome. Link: https://play.google.com/store/apps/details?id=com.horizonicblue.colourmatch This is my first game on Google play store. Play, Rate and Share the game, Have fun!!
-
Hey, so I was testing out some stuff for a possible game Idea I have which involves having a 'wall' of randomly jumbled blocks in it. I've only been learning javascript for a very short amount of time and only used Phaser as of today. I managed to create this 'wall' using the below code (feel free to point out any mistakes or improvements I could make): for (i=0;i<gridX.length;i++){ for (j=0;j<gridY.length;j++){ this.game.add.sprite(gridX[i], gridY[j],blocks[Math.floor((Math.random()*blocks.length))]); } } This wasn't the problem, the problem occurs when the blocks 'spawn'. Each block should have a black 1 pixel thick border, however some only have partial borders or nothing at all, more noticeably the pink and orange blocks. Any help would be greatly appreciated. Thanks! EDIT: I spread them out more and can now see black on all sides, however the bottom and left sides all seem darker/more visible still?