X3MC2

Members
  • Content Count

    29
  • Joined

  • Last visited

Everything posted by X3MC2

  1. Hi, Since the TouchCamera extends the FreeCamera class and works well both on Desktop and Mobile devices, why the need of the FreeCamera ?
  2. Hi, Some documentation classes (such as ArcRotateCamera ) return 404, were they moved somewhere else ? And also some tutorials are not displaying anymore. I'm I the only one who's getting the 404 error ? Can someone verify ?
  3. I need to set the X axis as Z and vice versa, so everything should be ZYX instead of XYZ, is it possible ?
  4. @RaananW Thank you for the great work you've done !
  5. Why ? var rawVerts = object.getVerticesData ? object.getVerticesData(BABYLON.VertexBuffer.PositionKind) : []; var rawFaces = object.getIndices ? object.getIndices() : []; BABYLON.Tools.Warn("MeshImpostor only collides against spheres."); returnValue = new CANNON.Trimesh(rawVerts, rawFaces); Even tho CannonJS supports mesh/plane collision ? : Demo : https://schteppe.github.io/cannon.js/demos/bunny.html Source : https://github.com/schteppe/cannon.js/blob/master/demos/bunny.html // ground plane var groundShape = new CANNON.Plane(); var groundBody = new CANNON.Body({ mass: 0, position: new CANNON.Vec3(0,0,-5) }); groundBody.addShape(groundShape); world.addBody(groundBody); demo.addVisual(groundBody); Edit: Ok, I overlooked the fact that the Mesh impostor is infact a Trimesh shape (https://schteppe.github.io/cannon.js/demos/trimesh.html). So can you add ConvexPolyhedron shapes in the next release please ?
  6. X3MC2

    free camera rotation?

    @Deltakosh There seems to be something wrong when assigning something to a Vector3 method like .position or .rotation, I've noticed this behavior before and I thought that I was doing something wrong, what I did is create two box meshes "Box1" and "Box2" and set : box1.position = box2.position; This somehow affected the box2.position. And @Xav's example shows exactly whats wrong, but using a variable instead. camera.rotation=rot; Is also acting like : rot = camera.rotation;
  7. X3MC2

    buggy shadow, also on wrong side?

    Parenting the light to the camera was the issue. http://www.babylonjs-playground.com/#MKF8U#2
  8. Forced the physics to update the body of the child, now it seems to work: http://www.babylonjs-playground.com/#18UP4N#2 But its nowhere near a robust solution, it needs more tweaking .
  9. Hi there, I'm stuck and I can't seem to find a workaround for achieving this, basically what I wanna do is set the Camera as a parent for a small Platform which has a Box impostor of Mass 0, and make a crate which also has physics (Mass 1) land on it. But the problem is that the platform acts as if it has no physics at all, instead of landing on it, the crate goes through , here is the PG : http://www.babylonjs-playground.com/#18UP4N Any help would be really appreciated. Thanks.
  10. X3MC2

    babylon viewer

    The only way you can do it is by creating an invisible mesh parent which will hold the loaded obj models, since there are some obj models out there that contain more that one mesh, and often they do not have the same scaling factor. After that you should set the scaling of each mesh to : parent.getBoundingInfo().boundingBox.extendSize; Here is an example : var container = BABYLON.Mesh.CreateBox("ObjParent", 1, scene); container.position = new BABYLON.Vector3(myposZ,myposY,myposZ); container.rotation = new BABYLON.Vector3(0,0,0); container.scaling = new BABYLON.Vector3(myscalingX,myscalingY,myscalingZ); var OBJ = loader.addMeshTask("ObjLoader", "", "", "batman.obj"); OBJ.onSuccess = function (t) { t.loadedMeshes.forEach(function (m, i) { m.parent = container; m.scaling = container.getBoundingInfo().boundingBox.extendSize; m.position = new BABYLON.Vector3(0,0,0); // Put at the origin of the parent }); };
  11. Hi there Mr.Wingnut , actually I need to parent the greenbox to the camera (Player) , I'm working on a small demo where you play as a steward (The camera) and have to deliver a cup (The crate) on a platter (The green box) while avoiding dropping it. So the greenbox should be carried, and the only way to do this is to set the camera as its parent, but there is something wrong with the parenting of a rigid body, after some invistigation, it turns out that parenting does not dispose the physics impostor of the child, the physics body is still there but does not follow its mesh anymore after parenting. Its like the parenting is only applied to the physicsImpostor.object, the physicsImpostor.body and its shape are being left alone. Well atleast this is what I noticed after some tests. One more thing, I cannot create a compound object between the camera and the greenbox since the camera does not have physics, and even if I do add a physics impostor to it, it does not work well with the native controls.
  12. Hello everyone, Seems like this playground doesn't work offline http://www.babylonjs-playground.com/#E6OZX#6 , I get this error : BJS - [18:56:31]: Babylon.js engine (v2.5.-beta) launched (index):56 Uncaught TypeError: BABYLON.SkyMaterial is not a constructor Edit: Silly me, the playground uses a material library , the babylon.skyMaterial.js To be locked, sorry for the inconvenience
  13. X3MC2

    Freecamera won't move in localhost

    No errors, just the info from babylon that it was launched : BJS - [16:37:16]: Babylon.js engine (v2.5.-alpha) launched As @aWeirdo mentionned, if setPreventDefault is set to false, it works. This thread can be closed, as the solution was given by aWeirdo.
  14. Hi there, I'm having a problem getting a playground sample to work on my xampp localhost, I got the Zip file of the Collisions example from the playground (http://www.babylonjs-playground.com/# -9 Collisions), the freecamera works perfectly when I run the online example, but when I test it on the localhost, the camera won't move at all, it will rotate with the mouse, but will not respond to my arrow key presses. Can someone explain why does the example works online and not on local ? Update: When tested using Internet Explorer, it works, but does not work using Firefox or Opera. So is there a difference between IE and other browsers conserning handling local html files ?
  15. X3MC2

    Freecamera won't move in localhost

    Yep its already included in the source:
  16. X3MC2

    Poor performance on iOS 10!!

    Crapple has made some changes regarding the class named UIWebView which is responsible in embedding web contents. Do not expect your HTML5 apps or games to work as expected since IOS 10 is still in its beta phase. You could downgrade to IOS 9. http://www.redmondpie.com/how-to-downgrade-ios-10-beta-to-ios-9.x-tutorial/
  17. Are you really importing thousands of models in a single scene ? Because that is beyond imaginable, I can't imagine a web browser handling such a tedious task. If I were you, I would have included all the models in a single .babylon scene and loaded it using the SceneLoader.
  18. X3MC2

    3DS MAX matches

    1- Only the Standard material : As for the supported maps: - Diffuse - Ambient - Specular - Bump - Emissive - Opacity - Reflection 2- I don't think the exporter supports HDR , you can only do it by code, check this tutorial : https://doc.babylonjs.com/tutorials/Using_the_HDR_Rendering_Pipeline 3- You cannot do it with 3DS max, define your radius in 3ds max, then put this code in the render loop : var camera = scene.getCameraByName("Camera001"); // 3ds camera name engine.runRenderLoop(function () { scene.render(); camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius; } );
  19. X3MC2

    3DS max pivot not exported

    Bingo, you sir deserve a cookie ! You saved me the time and effort of adjusting the pivot and compensating the translation. Now its fits perfectly the 3DS max pivot ! No need for code !
  20. Hi there, It seems like the exporter ignores my pivot changes and sets it to null each time I export the scene, I'm I missing something ?
  21. X3MC2

    3DS max pivot not exported

    Tried with pivot and working pivot, still the same, maybe the devs forgot to implement it because I can't find an option for it anywhere in the exporter. Well I think I'll just keep modifying it with notepad until I find the exact position. Have a nice day!
  22. X3MC2

    Degrees in 3D

    Here is your answer : https://www.reddit.com/r/explainlikeimfive/comments/1z6z2n/eli5_how_many_degrees_does_a_sphere_have_if_a/
  23. X3MC2

    Degrees in 3D

    No, not really. Rephrase your question if possible
  24. X3MC2

    Degrees in 3D

    There is no such thing as a 1080 °, the maximum angle in Math is 360 °, multiplying it by 2 or 3 has no effect, you just go back to 0° Take a look at this