SvenFrankson

Members
  • Content count

    47
  • Joined

  • Last visited

About SvenFrankson

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://www.svenfrankson.com
  • Twitter
    FranksonSven

Profile Information

  • Gender
    Male
  • Location
    France

Recent Profile Visitors

359 profile views
  1. Recalculate mesh shading

    Isn't it due to the fact the mesh worldMatrix is applied to the normal vector in the shader ? Something like vNormalW = world * vNormal , but I don't know where it happens when there's not Material assigned. Here maybe ? https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/default.vertex.fx#L115 maybe ? #ifdef NORMAL vNormalW = normalize(vec3(finalWorld * vec4(normalUpdated, 0.0))); #endif
  2. keypress on canvas not working

    KeyPress works because it logs, but with no effect in the scene when exchanging keypress and keydown events. In my browser, "keypress" has a different event object than "keyup" and "keydown" (keyCode is missing). KeyCode being deprecated (https://developer.mozilla.org/fr/docs/Web/Events/keydown), you might want to use a more reliable event property. Fixed here : http://www.babylonjs-playground.com/#SUXKHY#44 , if that's what your issue is. Best regards,
  3. Babylon GUI and hardwareScalingLevel

    Hi, Isn't the scaling happening here for the GUI Button ? That's where I can have it working. https://github.com/BabylonJS/Babylon.js/blob/d95b5a73877bdf2d89da63a9db53fe097150562a/gui/src/advancedDynamicTexture.ts#L354 (I'm not yet very familiar with the pointer observable design, but I think the methods from scene.ts are not called when clicking on GUI button) Best regards !
  4. I might be because you have not installed Typescript extensions for VsCode, so it's not parsing the .d.ts file. https://code.visualstudio.com/docs/languages/typescript Also, on my VsCode setup there's no intellisense / hint / autocomplete when writing scripts into the <script></script> tags of a .html document. Maybe you should try in a separate .js or .ts file.
  5. Babylon GUI and hardwareScalingLevel

    Hi everyone, I have some issues with BABYLON.GUI on devices with more than one pixel per pixel. (third topic this month concerning pixel ratio... ^^' ) https://www.babylonjs-playground.com/#XCPP9Y#216 I think the pointDown event has a value in "layout pixel", but the GUI lib uses it as "texture pixel", so it's out (if you put your cursor down right the window, you will see it fires the pointer event) My guess : 1) Either the layout should be made in "layout pixel" : When a box is said to have a height of 100px, on a device with 0.5 ratio, it's 200px on the AdvancedRenderingTexture. 2) Either we scale the pointerInput Vector2 argument. 3) I missed an already existing option to solve this. I'd say option 1 makes more sense, also 3 is more likely to happen But it's up to you. Should I submit a PR ? Thanks and have a nice day !
  6. Hi, It loads here, I have the same scene as you. If it's huge, and stored in the localstorage, maybe you're exceeding the capacity of your local storage ? I think it's something like 5 or 10Mo by default. Have you tried extracting the scene data causing you troubles and displaying them in a json reader application ? (like any IDE or Notepad), this way you can check if it's still valid JSON.
  7. How to lock Arc Camera up down

    Hi, Set Beta limits to your Camera Beta value can do the trick : https://www.babylonjs-playground.com/#Y3RD10#11
  8. A workaround for the yellow text : https://www.babylonjs-playground.com/#ZI9AK7#117
  9. Create meshes based on prototype mesh

    Topic-jacking ! http://www.babylonjs-playground.com/#Y3RD10#6 with clones when creating mesh-1 and mesh-2, it does not work.
  10. Create meshes based on prototype mesh

    No idea why your PG don't works, but I had the same issue and solved it like this : http://www.babylonjs-playground.com/#Y3RD10#5 I guess it's because of some caching magic with the geometry property
  11. Can You Get Normalized Velocity

    Not sure if I understood your question well. It's a generic question or you have a use case in particular ? Anyway, when doing this kind of thing (sharing code for animation or physic between human and AI), I'd rather have the AI returning inputs (-1 ; 1 values) than moving the object with translate / rotate / addForce (the translate / rotate / addForce being the same code for human an AI) Here, I'm not sure you can tell the object velocity (or normalized velocity) is equal to the input (or input direction), or it would mean your object has no inertia.
  12. Hi, We have a project where there's a need to get absoluteRotation and / or absoluteRotationQuaternion. Is there a need somewhere so a pull request about this is possible ? If so, is it wise to compute it here https://github.com/BabylonJS/Babylon.js/blob/88145e1d19e13c88afd09c63a474d0af15e0d7a1/src/Mesh/babylon.abstractMesh.ts#L1312 By adding _absoluteRotation and _absoluteRotationQuaternion private properties and this._worldMatrix.getRotationMatrixToRef(Tmp.Matrix[0]); BABYLON.Quaternion.FromRotationMatrixToRef(Tmp.Matrix[0], this._absoluteRotationQuaternion); if (!this.rotationQuaternion) { this._absoluteRotationQuaternion.toEulerAnglesToRef(this._absoluteRotation); } Or should it be only done in a getAbsoluteRotation method to avoid the overhead of computing it every time computeWorldMatrix is invoked ? (note : what's the usage for this kind of question ? using the forum, GitHub issues or directly submitting a PR on GitHub ?) Thanks a lot and have a nice day !
  13. Ok maybe I misunderstood the issue ^^ Here's a playground were hardwareScaling is forced to 0.5 http://playground.babylonjs.com/#EE38I5#1 , I think it displays the values focomoso described in his first post It's canvas.clientHeight, which takes into account the device pixel ratio (not canvas.height ,as I thought)
  14. Why don't you use canvas.clientHeight and canvas.clientWidth ? Unless I misunderstood your issue, it's the value you're looking for. (or engine.getRenderingCanvas().clientWidth, if for some reason you can't access the canvas object directly, like in the playground) For what it worth, to me, it does make sense that the renderWidth is different from the canvas width when you're working on a device with a pixel ratio not equal to 1. The engine renders on a texture, which resolution is set in hardware pixel. If you wan't to CSS this texture or mouse over it, it's expressed in logical pixels. I have a lot of issues with the concept of pixel ratio lately, when I got my first screen with a pixel ratio > 1. These articles were kinda helpful : https://stackoverflow.com/questions/8785643/what-exactly-is-device-pixel-ratio https://alistapart.com/article/a-pixel-identity-crisis As well as brianzinn inputs here : Good luck !
  15. BABYLON.Augmented Reality ... in AR.JS

    var mesh = new BABYLON.Mesh("Mesh", scene); mesh.isVisible = false; Could it do the job ?