KarelAnker

Members
  • Content Count

    35
  • Joined

  • Last visited

Everything posted by KarelAnker

  1. I've partially fixed it, however there's one problem which I can't figure out: http://www.babylonjs-playground.com/#RF9W9#181 As you can see, when you add the "cap" option, there are some weird black parts and parts which shouldn't be capped at all. (PS: I added some alpha so you can see the yellow line representing the shape..)
  2. Ah.. Do you have any alternative suggestions to achieve my idea?
  3. http://imgur.com/PDBj6MG Basically I'm trying to extrude a shape on the Y axis. All of the points have a Y of 0, only the X and Z are differing each time. When you're looking at the picture, you can see the white lines are the points connected by BABYLON.MeshBuilder.CreateLines, so the points shouldn't be the problem. However, if you are looking at that big grey thing going in the air, that's the extruded shape from the points. It seems that it doesn't extrude properly on the Y axis so it's really messed up. The code looks like this: BABYLON.MeshBuilder.CreateLines("line", { points: meshPoints }, scene);var block = BABYLON.MeshBuilder.ExtrudeShape("block", {shape: meshPoints,path: [new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(0, 0, 0)],scale: 1,cap: BABYLON.Mesh.CAP_ALL}, scene);As you can see, I just want it to be extruded from the bottom to the top, which should result in a box which follows the mesh points. It should look like the white lines, but then filled up and having a "height" to it.
  4. https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/materials/terrain Haven't found out how it works, there's not really any documentation about it.
  5. Not sure if it's a bug I created or something... Anyways, whenever you start the BabylonJS debugger, and go to the Generals tab and tick Clickable labels, it outputs this error: "Uncaught TypeError: Cannot read property 'getViewMatrix' of undefined" on line 27344 (development version of Babylon, .max version), which is this line: _this._camera.getViewMatrix().multiplyToRef(_this._camera.getProjectionMatrix(), _this._transformationMatrix);I guess the _camera variable doesn't exist. Like I said I'm not sure if I caused the problem, as some examples show them working correctly, but I can't seem to have it working in my game
  6. You could use a raycast each frame from the position of the camera of 1 frame ago to the position of the camera at the current frame. If something hits in that raycast, then you should set the camera position to the hit world position. Or have the raycast from the current camera position to the mesh you're looking at.
  7. (on another note, what rotation should the object be and in what rotation order)
  8. I'm excited for the splat mapping material tho, seems promising when the documentation is up
  9. The weird thing is that this works: var assetsManager = new BABYLON.AssetsManager(scene);var meshTask = assetsManager.addMeshTask("skull task", "", "./objs/", "skull.babylon");// You can handle success and error on a per-task basis (onSuccess, onError)meshTask.onSuccess = function (task) { task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0, 0);}// But you can also do it on the assets manager itself (onTaskSuccess, onTaskError)assetsManager.onTaskError = function (task) { console.log("error while loading " + task.name);}assetsManager.load();But BABYLON.SceneLoader.ImportMesh doesn't
  10. I've edited the main post a few minutes before you posted this There's not really something else.. There's no other setting that I'm changing or something.
  11. The newest Express doesn't really seem to be handling the Babylon files correctly, even after setting the mime types. I'm using express.static with a folder, and every time BabylonJS downloads the file but doesn't create a mesh afterwards. Going to the link directly in your browser downloads the mesh instead of showing the data (not sure if this is intended) The appropriate mime types are set, looking them up by file extension also returns these types. Basically the code to have the mime types is this: express.static.mime.define({ 'application/babylon': ['babylon'], 'application/fx': ['fx'], 'application/babylonmeshdata': ['babylonmeshdata']});app.use(express.static('YOUR FOLDER'));Client: BABYLON.SceneLoader.ImportMesh("test", "objs/", "skull.babylon", scene, function (newMeshes) { console.log("mesh loaded"); console.log(arguments); // This logs: [Array[0], Array[0], Array[0]]});skull.babylon is the skull which you see often on the Babylon playground. The Chrome Networking tool returns this for skull.babylon: It seems that the networking tool actually does get the correct information:http://puu.sh/loUkK/f5a4213053.png But that "newMeshes" in the client code returns an array of size 0
  12. I currently have a terrain that should cast shadows and receive them from itself. I need to use a shadowGenerator for it which doesn't use variance shadow map. I have a very high bias for this, as otherwise the shadow looks horrible. The problem is that I also want objects where you do use variance shadow map with a low bias. I thought you could just create a new shadow generator and then use that, however it seems that the last shadow generator which I've declared gets used and the other doesn't. This means that or the terrain can't cast shadows to itself, or the objects can't cast shadows. Playground link: http://playground.babylonjs.com/#1IP45
  13. http://www.babylonjs-playground.com/#KA93U#16 That's what appears in the console, having too much warnings makes WebGL not give any more information until you refresh your page.
  14. I think he wants to know how to enable WebGL on his own custom browser which he made on VBNet
  15. I'm unsure how, as I don't know how to create the TypeScripts and the minified files, and I don't know which file to exactly edit EDIT: created a pull request
  16. Got it to work! You basically forgot to set the crossOrigin attribute to anonymous. var music = new BABYLON.Sound("Music", ........................);music._htmlAudioElement.crossOrigin = "anonymous";I would create a pull request but I don't dare to touch it (Also, it seems that you can't attach the audio to an object, it's always 2D with the streaming tag)
  17. EDIT: It seems that the HTML5 audio tag does not allow any streaming outside of the local file system. Try streaming "http://ccmixter.org/content/teru/teru_-_We_re_on_the_Roll.mp3", the header has Access-Control-Allow-Origin: *, but for some reason when you're trying to stream Chrome outputs "MediaElementAudioSource outputs zeroes due to CORS access restrictions for ......." You can check the receiving headers at http://www.rexswain.com/httpview.html
  18. Got it working, just create a new biquad filter and pass it to the sound
  19. But there's no way to have it 3D spatial with a HTML audio tag?
  20. Is this possible with Babylon, as creating a new BABYLON.Sound will preload your song fully before you can listen to it. I basically want it to download parts. When you have a 10 minute song, I don't want it to download all the 10 minutes, I want it to download the part it's currently playing + some minutes.
  21. Yeah but I wanted to know why these shadows look great while the shadow maps look pretty awful
  22. ThreeJS is opensource, maybe look at how they are casting the shadows, as the shadows on ThreeJS are really great looking. I do wonder how you got the shadows working on http://playground.babylonjs.com/?14 , as these look smooth and cast and receive the shadows
  23. Is there any way to fix it on my part? (guess not, after reading this comment) Does this same effect happen with variance shadowmaps?
  24. Hey, I basically have a problem, which is easiest to describe as following: I have a terrain, it should receive shadows from itself and cast them. The problem is that the terrain doesn't have 1 height. On certain positions its higher than other spots. However, the shadows are really awful when you have a terrain like this which should cast and receive shadows. Here's a picture of what I mean: Code: shadowGenerator = new BABYLON.ShadowGenerator(4 * 1024, light);shadowGenerator.bias = 0.00001;shadowGenerator.usePoissonSampling = true;Upping the bias kinda matters, but it's not the effect that I desire, because only fully shadowed places will be black, like this: Decreasing / increasing shadow quality just makes the triangles on the shadows bigger or smaller. Close up of the shadow: http://imgur.com/lSqb4IH ==