ssaket

Members
  • Content Count

    39
  • Joined

  • Last visited

  • Days Won

    1

ssaket last won the day on October 12

ssaket had the most liked content!

1 Follower

About ssaket

  • Rank
    Advanced Member

Profile Information

  • Location
    Bengaluru, India

Recent Profile Visitors

131 profile views
  1. Thanks yeah.. ! Happens more frequently when you do a jerk motion, though not sure about the scaling, I found it helpful when it scales bigger than sphere for distant 'z' positions, kindda gives me option to roll back.
  2. Hi there, please go through the official documentation, it covers all your questions (https://doc.babylonjs.com/how_to/parametric_shapes) TL;DR For Non Regular Polygon/ Extruded Non Regular Polygon -> the path should be in x0z plane. and you can use extrude shapes in both z and y direction (ref - https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes) Hope this helps, happy learning
  3. Hey ! This happens because of the SceneLoader's asset/resource path finder algorithm, it doesn't check for relative paths and tries to take the index.html's path as the base/root location and based on this locates the assets. { ../ , ./ doesn't work ! } Possible solutions - 1. Using imports and replacing all the hard coded string values (just like we import images) but problem with this is we might not know how many imports to make ! 2. Other solution is to place the assets in the root dir (in this case /public) rather than in /src, but again, it has its own disadvantages like compressing etc. Feel free to choose any one of above, here are the updated files (https://codesandbox.io/s/1z65177p73) You also have Webpack copy plugin (https://github.com/webpack-contrib/copy-webpack-plugin) which copies the resource and dumps it into dist or anywhere else and public path for your envs https://webpack.js.org/guides/public-path/
  4. ssaket

    GUI Input Text Behavior

    @Deltakosh If we want to add ctr-v feature, then a new event type (ClipBoard)https://developer.mozilla.org/en-US/docs/Web/Events/copy has to be added in core module along with KeyboardEvents and MouseEvent. Going through the current code I couldn't understand where are we registering/removing them from the DOM Events. Any guidance is much appreciated
  5. ssaket

    PC Port

    @RavZkie not sure if this is helpful, but feel free to check https://github.com/ssaket/babylonjs-electron-starter It has both loader and material external libs pre-installed.
  6. ssaket

    GUI Input Text Behavior

    Solved it, if we call this.onFocus before the return, it solves the focus problem EDIT: I want to create a PR but its just 1 line. public processKey(keyCode: number, key?: string) { // Specific cases switch (keyCode) { case 32: //SPACE key = " "; //ie11 key for space is "Spacebar" break; case 8: // BACKSPACE if (this._text && this._text.length > 0) { if (this._cursorOffset === 0) { this.text = this._text.substr(0, this._text.length - 1); } else { let deletePosition = this._text.length - this._cursorOffset; if (deletePosition > 0) { this.text = this._text.slice(0, deletePosition - 1) + this._text.slice(deletePosition); } } } this.onFocus(); return;
  7. ssaket

    GUI Input Text Behavior

    yeahh.. I noticed, unfortunately I have to click again for 6-7 times after the first click Clicking in the PG area and back at the input doesn't seem to be working for me. this is happening for all input controls even passwords. bug repo- https://www.babylonjs-playground.com/#UB58DY#2 Edit: I have figured out the cause for the 2nd. The deletion logic is correct. It's just it is hidden. So, as a user when I delete the character till the the start position of the input box, I think I have deleted them all , but duhh !! they are hidden. I think we need to do a right shift to make the rest of the characters visible . Being a noob I don't how to implement this . Any suggestions ??
  8. ssaket

    GUI Input Text Behavior

    It's a bug in the core module; just checked for GUI, works fine. I think it's happing because of scene pointer events(seriously it has become a jinx now, one bug gets fixed and a new one gets introduced ). pinging @Deltakosh For ref - (https://www.babylonjs-playground.com/indexStable.html#UWS0TS)
  9. Use the A* algorithm; you can spawn enemy meshes at random locations and then find the min. path to the camera's position . Here, checkout this blog (http://theory.stanford.edu/~amitp/GameProgramming/) you can also use sound effects to determine from where the enemy is coming (like behind/ right etc)
  10. Hey there ! Could you create a playground for the same ? I know it's a trivial thing but it gets lot more easier for us to debug and solve the problem quickly. Meanwhile, the boilerplate is working fine for me, have a look (https://www.babylonjs-playground.com/#ZJYNY#90)
  11. It's because of never ending recursive calls between (could be because of something else too)- Mesh.TransformNode.computeWorldMatrix -> ArcRotateCamera._getTargetPosition -> Mesh.TransformNode.getAbsolutePosition though I don't know how to solve it It's like mesh and camera asking each other's world coordinates. dead lock !! lol !
  12. ssaket

    Pixel perfection

    Hey ! Welcome to the forum Try this - http://jsfiddle.net/zmatocef/ and here's the PG- https://playground.babylonjs.com/#M9XT7F#3 as you can see, if you use diag, the FOV for 0px offset still leaves some area(coz of sq root) which is because of the fact (basic maths) let's say you render size was 500*500; diag = Math.sqrt(500*500 + 500*500) => 500 * Math.sqrt(2); because of this (sqr 2)1.41 there's some region left in the view area. (same case happen with Three.js; you can try yourself! ) This is how the formula is derived -> tan(x) = height/ base. Now for FOV ( we have to find 2tan(x)) In our case tan(x) = (renderHeight/2)/ (distance) ; //(distance btw camera and mesh; because camera is in middle) now x = tan-1(renderHeight/ 2* distance); and FOV = 2x; if you use diagonal; you can't get accurate result (x in this case)
  13. ssaket

    Plane tangent to a sphere

    Hi there ! you can change the segment of the sphere to decided on number of planes. The solution uses facets normals- https://www.babylonjs-playground.com/#VDG184#7 Good day
  14. ssaket

    Shadow degrade after box moving

    @Sebavan if you can mentor me I would love to contribute