• Content Count

  • Joined

  • Last visited

About spritefire

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
    Melbourne, Australia

Recent Profile Visitors

1142 profile views
  1. Awesome! looks like it has been fixed I had noticed as well that the camera angle had changed a bit with the newer version ie the model was appearing half off the canvas with the new version and would be centered in canvas with older versions, but that also has been fixed now
  2. Hey guys, Just a heads up that some of my older content stopped working with the newer release (I reverted the links back from the standard Babylon link to CDN version specific links to fix the issue). Not sure what changes are coming in the next version, and I am happy to share the code when I get home so you can have a look and see if you can find whats causing the issue. Actually I have I'll just post now var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function () { var scene = new BABYLON.Scene(engine); var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(25, -15, 25), scene); var light1 = new BABYLON.PointLight("Omni1", new BABYLON.Vector3(-25, 25, 5), scene); var light2 = new BABYLON.PointLight("Omni2", new BABYLON.Vector3(0, 55, 10), scene); var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI/2*3, 0, 100, new BABYLON.Vector3(0, 0, 0), scene); BABYLON.SceneLoader.ImportMesh("", "babylon/", "desiren.babylon", scene, function (newMeshes) { camera.target = newMeshes[0]; scene.clearColor = new BABYLON.Color4(0,0,0,0); scene.getMeshByName("test").materialmesh; scene.textMat = new BABYLON.StandardMaterial("boxed", scene); scene.textMat.diffuseColor = new BABYLON.Color3(0.1, 0.1, 0.1); scene.textMat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); scene.getMeshByName("test").material = scene.textMat; scene.getMeshByName("test").position = new BABYLON.Vector3(0, 10, 0); scene.getMeshByName("test").rotationQuaternion = null; scene.registerBeforeRender(function () { }); }); return scene; } var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); In the meantime I'd recommend looking at some older content too and seeing if the later babylon works with that. The code wasn't very complex so it will probably occur for other too who aren't linking to specific versions of babylon.
  3. http://doc.babylonjs.com/classes/2.2/ArcRotateCamera " Create a new ArcRotateCamera. ArcRotateCamera is a camera that rotates around a given pivot. It can be controlled with the mouse or touch events (and it also requires hand.js to work) A tutorial aboutArcRotateCamera can be found here " The last word 'here' should be a link. I think it should point here: http://doc.babylonjs.com/tutorials/05._Cameras
  4. I have two babylon engines running and both work perfect. I have one displayed as none and then display it after an event. However, it wont display, but does display if I open (or move) the dev console window. I've read on stack exchange that this issue could be a console.log issue (which makes sense as both engines log onto the console). If this is the cased, how do I deactivate the console log (without going through the code - ie hoping for a flag etc).
  5. Ugh please ignore. I just noticed I had BABYLON.Animation.ANIMATIONTYPE_FLOAT instead of BABYLON.Animation.ANIMATIONTYPE_COLOR3. The perils of copying and pasting segments of code :/
  6. Using Max2Babylon-0.25 Not sure if meshes, however I access the bones through babylon's skeleton property. ie BABYLON.SceneLoader.ImportMesh("", "", "man.babylon", scene, function (newMeshes, particleSystems, skeleton) { scene.meshMan = newMeshes[0]; scene.skeleton = skeleton[0]; scene.clearColor = new BABYLON.Color4(0,0,0,0); }); scene.beginAnimation(scene.skeleton, 10, 20, false, 0.8);
  7. The latest exporter is working fine with me using 3ds max 2015. Maybe you are using a different version of the exporter? I do know that when I originally posted this I reverted back to an earlier version of the exporter and that fixed the issue. I'd double check to make sure you are using the correct/latest version.
  8. Hiyas Just wondering if there is a way to create an animation (without using the scene.registerBeforeRender ) that changes / blends materials? I want a mesh to fade from one diffuse colour into another. I have it working using scene.registerBeforeRender however there are a lot of different meshes that have different animations at different key frames and am hoping it can be done easier. I have a feeling that it's to do with the target property "material" (but I would assume this would be ok) or the values in the keys? var glowLogoMaterialKeys = []; var animationGlowLogoMaterial = new BABYLON.Animation("glowLogoMaterialKeys", "material", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); glowLogoMaterialKeys.push( { frame: 0, value: new BABYLON.Color3(1, 0, 0) }, { frame: 20, value: new BABYLON.Color3(0, 1, 0) } ); animationGlowLogoMaterial.setKeys(glowLogoMaterialKeys); scene.glowLogo.animations.push(animationGlowLogoMaterial); scene.beginAnimation(scene.glowLogo, 0, 100, false); I have also tried with target property of "material.diffuseColor" and still no luck
  9. The page with error 3 - Helper function Animation.CreateAndStartAnimation = function(name, mesh, tartgetProperty, framePerSecond, totalFrame, from, to, loopMode); tartgetProperty unless they meant getting the property of delicious tarts
  10. Ahh I had a silly mistake in my code :/ Jerome was right about it being answered (you can use urlData as a texture via buffer). I also found this working example in the playground: http://www.babylonjs-playground.com/#17YNKA I had replicated it and it still wasn't working and even copied my image data to the playground (which worked).. and went and had a cup of coffee went back to my code and saw I had two lines of code of the same thing :/ This is awesome that you can do this though. Has so many possibilities. Can move the data around on the mesh on the fly, grab it and throw it onto a 2d canvas and then add filters, or bake lighting etc and then place it back up on the mesh or do some procedural textures etc
  11. Hey guys, Just a quick question because couldn't find any info anywhere. Is it possible to use image data as a texture? if so how would i go about it? I'm not having much luck ie var image= canvas.toDataURL("image/jpg"); Can post this to the server and create image file which works fine which I can then change the texture on the mesh with that file. But what I would like to do is just skip the server upload / file creation so the data is used directly. scene.mesh.material.diffuseTexture.dispose();scene.mesh.material.diffuseTexture = new BABYLON.Texture(image, scene); //works if its a file created by the data, but not if it is just the data.
  12. Thanks!! (been away a bit doing studies but should be back here a bit more now that an assignment is out of the way)
  13. I must be doing something wrong or missing something. When I render the PNG using var screenshot = new BABYLON.Tools.CreateScreenshot(engine, myCamera, 400); console.log(screenshot); It automatically starts the download (don't want it to download on the client end, just want it to take a snapshot and send to server) and the console returns: d.CreateScreenshot {} and not the PNG as a string.
  14. I noticed that there is a function to create a screenshot (https://github.com/BabylonJS/Babylon.js/wiki/Render-scene-on-a-PNG-(Screenshot)), however couldn't find any information about being able to create a screenshot of the canvas and then it being saved on the server. Is it possible to do this? and if so how would I specify the location?
  15. Thanks I had two other controllers in different parallel scopes affecting a nested function within the canvas controller which was using babylon as a directive and couldn't get them firing the functions correctly and noticed you had used $rootscope so I applied that and working great now. Not sure if it's the best way but couldn't see any other way to do it.