Jump to content

jonathanlurie

Members
  • Content Count

    15
  • Joined

  • Last visited

  • Days Won

    1

jonathanlurie last won the day on March 31 2018

jonathanlurie had the most liked content!

About jonathanlurie

  • Rank
    Member

Contact Methods

  • Website URL
    http://me.jonathanlurie.fr
  • Twitter
    jonathanlurie

Profile Information

  • Gender
    Male
  • Location
    Montreal
  • Interests
    Computer graphics, image processing, computational geometry, this kind of things...

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Great! I'll try that tomorrow and I'll let you know!
  2. Hello all, I've been working a bit with 3D textures lately, to display MRI which are sometimes (more often than not) encoded in Float32. So far, I was converting the data into uint8 on a single channel (LUMINANCE) but then thought it would be nice to have my data sent to the GPU directly as Float32 (single channel: gl.R32F ). And I found a bug! Or rather something that I suspect to have been overlooked because not a lot of people uses 3D textures and even less want to have floating point precision. The guilty line of code lays in the Engine L5926 (link). When creating the 3D texture,
  3. Hey @Sebavan , thanks for the fix! You're right, using BABYLON.Quaternion.RotationYawPitchRoll(y, x, z) is a solid alternative! I've just updated to v3.2.0-rc.2 and now I can get my user to think in Euler angles (read/write) but have all my internal logic in quaternions!! Thanks for your reactivity on the updates and on providing playground examples, highly appreciated! Cheers.
  4. Thanks @Sebavan for the playground! It looks like both are still moving... Also, you made me realize I forgot to normalize my quat!
  5. I now know that it's the method 'Vector3.toQuaternion()' that is guilty! In my project, I just replaced it by a piece of code I borrowed from glMatrix that made more Babylony: function eulerAngleToQuaternion( eulerAngle={x:0, y:0, z:0}) { let toHalf = 0.5; let x = eulerAngle.x * toHalf; let y = eulerAngle.y * toHalf; let z = eulerAngle.z * toHalf; let sx = Math.sin(x); let cx = Math.cos(x); let sy = Math.sin(y); let cy = Math.cos(y); let sz = Math.sin(z); let cz = Math.cos(z); let quat = { x: sx * cy * cz - cx * sy * sz, y: cx
  6. Hey all, I've been playing a bit with quaternions to rotate meshes but I also need to use Euler angles. The quaternions are great for my internal cooking because (imo) they are easier to use and more versatile than Euler angles, but Euler angles are good for UI, it speaks to people (especially if we convert everything into degrees (the audience of the app is neuroscience researchers, so they would probably think quaternions are black magic). The BJS doc says "once you have used a quaternion, the rotation property of a mesh become null and basically no longer usable". Fortunately, we
  7. Hello, I've been messing around with some colormaps I generate. I have a ShaderMaterial and would like to send some colormaps to the shader using ShaderMaterial.setTexture(). My colormaps are dynamically generated and result in a RGB image stored as a Uint8Array. To illustrate the test, I am using a 1x1 texture. I have no problem a RGBA image as uniform on the shader, like that: // this works well let cmTexture = new BABYLON.RawTexture( new Uint8Array([128, 128, 128, 255]), // data 1, // width 1, // height BABYLON.Engine.TEXTUREFORMAT_RGBA, // format this._scene, // sce
  8. Hey @Deltakosh , I finally took the time to bake a more robust demo, it's here and the source is on Github and part of the list of Pixpipe's example. It's ok to share because all the scripts are on CDN and the volume data as well
  9. I am making a cleaner example that I can share but there is a thing. My 3D texture comes from an MRI (NIfTI file) and is encoded in Float32. For the sake of simplicity, I was so far converting the buffer from Float32Array into a Uint8Array and used BABYLON.Engine.TEXTUREFORMAT_LUMINANCE as a format. I'd rather use a flag that let me use the original float buffer, it would same time, memory and would allow more operation once on the shader. I thought of doing: let texture3D = new BABYLON.RawTexture3D( img3D._data, // <--- THIS IS a Float32Array dim0, dim1, dim2, BABYLON.Engin
  10. Hi @Deltakosh , I am currently cleaning up this example a bit to make it more robust because for now, a lot of things are dirty and hardcoded. As soon as it's cleaner (hopefully this week), I'll let you know!! Thanks
  11. Well, it's already a custom shader and by discarding back, do you mean discarding the black surrounding? If so, then no, researchers and clinicians are used to keep the surrounding because getting rid of it (with a simple threshold) could mean discarding important signal.
  12. YEAH! it works perfectly! Thanks for adding that to the core! For loading the MRI data I use Pixpipe , which is a lib I am developing at the Montreal Neurological Hospital. I will share this example in a git page because I am not too sure how to deal with dependencies and remote data in a PG, and also the MRI has to be loaded in advance and use a callback that only then creates the scene -- I'm not sure we can do that in the playground. I will update this thread when I have a cleaner source to share! But in the meantime, here is a youtube capture of it in action:
  13. Hi all, I am new here and new with BJS so I might ask for something obvious. Though, I looked well in the resources, how-tos and was digging pretty deeply into BJS codebase and couldn't find any answer. Also, in case of lack of satisfying answers, I'll also post my own solution to my problem (a hack). I want to load a 3D texture of a brain (MRI) and display it on 3 orthogonal planes, then i can move my plane-set around, and even spin it to display oblique slices. On my GLSL code, i need to load my 3D texture as a sampler3D and lookup for some world coordinates to feed gl_FragColor with
×
×
  • Create New...