spritefire

Members
  • Content Count

    76
  • Joined

  • Last visited

Everything posted by spritefire

  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.
  16. Hey guys, Has anyone used babylonjs along with angularjs? I haven't come across any documentation for it, I did come across some for threejs and would assume its done a similar way. Their url is a bit NSFW :/ http://twofuckingdevelopers.com/2014/02/mixing-angularjs-threejs/ Just curious if anyone has done it before and if they came across any issues. Cheers
  17. Just make a blank file named man3.babylon.manifest
  18. Ripped out bones that were just sitting there not doing any animation (from 60 down to 23) and its working great on ipad and iphone. Could probably add more bones if needed but working as intended
  19. Is it just the camera or is it all keyboard controls are no longer accessible in the canvas? I've created a few things using babylonjs and iframes interacting with each other (don't use iframes any more tho). Without seeing the code itself (and assuming the keyboard controls don't work while accessing/focusing the iframe) you could create keyboard functions within the iframe itself that target and interact with the babylonjs code (and vice versa), might not be the best solution for what you need but will definitely work. You could also utilise it to create macros that you can access via the iframe (ie rotate and face the front of the object in one click).
  20. Is there a number of limitations to the bones? the rabbits seem to work with their bones but not the soldiers. If I know a number I maybe able to remove some of the bones from my model to make it work on ipad. Or I could break the model up into limbs and animate each limb separately but don't want to start tearing model apart unless I know what the limitations are so I can tear him apart correctly.
  21. Haven't got access to my ipad at the moment (girlfriend fell asleep with it reading reddit). Does any of it load or just part of it? I have an issue wit the ipad mini at the moment and wondering if maybe if its to do with the model in the scene, and if so what in the model is not allowing it to work on the ipad. btw, the scene is doing some really strange stuff in your example when viewed and rotated on a pc. Its as though the 'walls' are following the controls and cut off parts of the models as you rotate.
  22. I'm just accessing the babylonjs.com page via the latest ipad mini and noticed that the soldier animations don't load on both the instanced bones example and also the bones example. Just curious as to what would be causing this as I have created an animation using the same example (but with a different model with approx 10k verts) its not not working for me either. I haven't looked at all of the tests but things like the skull and volumetric lightning work and the rabbits also work (with their shadows) on the bones example. Are there any vertices limitations with the ipad? if not, what could be causing it to not display? Also note that with the instanced bones the soldiers are not visual but the frame rate alternates between 50-60 frames per second.
  23. I think having a fog that is all the one level of height shouldn't be too difficult to achieve. Just use a pane that covers the area that uses a texture that is grainy and has opacity along with FOD for the horizon. To have the fog move you could use a dynamic moving texture moving very slowly and for when you view below the fog line having a grainy opacity texture on a pane that is in front of the view port (and the pane raises and lowers to meet the horizon of the fog) to give the illusion of immersion and thickness. Maybe also could add the very, very, very slightest reflection (like how the water effects are done) just to make it awesome. That said this same technique (pane in view port) could also be used for underwater effects too. That way it is super light weight on the processor (would work on mobile) and easy to achieve. I don't think you would need fluid dynamics unless you wanted it to have a smoke affect where wind would create currents (which would be awesome) however that unit of the course I am doing to create shaders etc is a few months away so can't create something like that (just yet).
  24. Did you unlock the zipped file while it was still zipped or unlocked them individually after? I've found issues when unlocking them after unzipping the files. Also its possible that your download was corrupt, so you might retry downloading again and unlock the zipped babylon file (not just the max3babylon zipped folder that also comes zipped) and copy them across again.
  25. That is strange because I had tried it without the name before I had removed the edit poly modifier and still was unable to get it to work. Maybe it was what I had done in the edit poly and where I had placed it (had created it above the skin modifier and then dragged it below it). I still have the archive of the file that has it set up that way. I will do some testing on it (ie export that model with the code that is working with the updated model) and see what the results are.