• Content Count

  • Joined

  • Last visited

About Phuein

  • Rank
    Advanced Member

Recent Profile Visitors

71 profile views
  1. That's the most bizarre hack. Literally moving the entire world. No way I'm doing that. When I implement the parenting system I got in mind, if it works, I'll post it here and mark solved. So others can replicate the code.
  2. I see. So, both the new UniversalCamera and its predecessor FreeCamera are really FPSCamera. FreeCamera doesn't have rotationQuaternion in its class, unlike TargetCamera (doesn't extend that part eh), and adding class properties to an input file would break logic. I actually like the InputsManager logic. Then I agree. BABYLON.FlyCamera with its own inputs. It's a shame (on coders) to duplicate some of the movement code (such as some of the keyboard movement), but mixing everything up is a big bad salad, indeed. I'll start working on my fork then, towards a PR. Any input welcome. ­čĹî
  3. Phuein

    Improving API Browsing

    After figuring out another issue with the docs (adding "Defined in" to API), I felt emboldened to try to figure this feature request once more. So I spent a few hours. TypeScript... TypeDoc... Grunt... Handlebars....... Okay. So, between the code being in TS (which I don't use) and abstracted even further with Handlebars, I can't even perform basic JS operations on the site. Not without creating a further step that adds my JS into the compiled docs pages, which seems like terribly bad practice. <rants> What an abstraction nightmare. Taking something simple like JS and turning it into a whole bunch of new API's. ><" Any idea how I could add a Handlebars Helper function to, and I'm broadly assuming, /typedoc/babylon.d.ts? With that I'd be able to add JS controls to the template file /typedoc/default/partials/index.hbs, which would let me add the nifty index by letter.
  4. This is the order in which the cameras (relevant to me) extend each other, but also often override each other: UniversalCamera extends TouchCamera extends FreeCamera extends TargetCamera [extends Camera.] How come FreeCamera doesn't use rotationQauternion and allow rotation around its Z (roll) axis by default? After all, TargetCamera does use quaternions, even though it ignores the Z axis by design. But a FreeCamera should be that much free, right? Wrong? I saw that FreeCamera abstracts its inputs. It would make sense for the mouse input to use quaternions for full freedom of rotation in all axis. Desu ne? I'm itching to make a pull request that, while keeping backwards compatibility, adds more freedom to rotation (Z axis roll) and movement (QE for In/Out.) But I'm new, so I don't want to code stuff and then get denied.
  5. What exactly do you mean by moving the world? I thought you meant just a parent. Has an idea about parenting and unparenting consecutively, to a new empty mesh in location, whenever local distance goes over a certain number; instead of dividing space ahead of time.
  6. Phuein

    Ambient Light Discussion

    Agreed. But why can't I change the default ambientColor property in StandardMaterial without remaking/workarounds? Something akin to: BABYLON´╗┐.StandardMaterial.prototype´╗┐´╗┐´╗┐´╗┐.ambientColor ´╗┐= new BABYLON.Color3(1, 1, 1)´╗┐ An override, no need for loops. Why don't the class defaults draw from public variables that can be modified? I noticed this pattern in the engine.
  7. Ah, they're both shaky as heck for me. (1mb vid attached... should I have linked to an imgur gif instead?) So, let's see if I got this straight. The issue is numbers with too many (over float32) digits ("124512541.2512412"), which is - in this case - an issue with being "very far away" from the mesh's parent position (axis.) So, if I use parents for different "areas", I can keep movement cut into zones, which keep the numbers low? i.e. rookie numbers. Is that right? I'm still not sure how I would move my mesh these distances this way. I'd need... err... a matrix of parents, each reducing the distance from axis? So, first set of parents divides by say 10. Then each has 10 parent-children, dividing further by 10. And so on, until my mesh is attached to its parent where the distances are acceptable. So, for a distance of a trillion units ("meters") it's... 10 ^ 12... Meaning dividing every space section into 10 subspace section, 12 times. Hrm. Goes deeper into the mathematical darkness of Javascript... Learning of numeric evils.... More specifically, I'm seeing THREE do this: #define USE_LOGDEPTHBUF But they do it for the renderer, optionally - set option in Render() object creation. Would that be at all achievable with BJS? 2018-09-19_12-19-09.mp4
  8. Phuein

    Ambient Light Discussion

    Hrm, cool, there's an onNewMaterialAddedObservable. Nifty. Hold on though. I appreciate the work-arounds, but I'm confused. Isn't the whole point of an Ambient Light that it is set to White on all materials by default? That it is a quick ambient light, basically, no extra code necessary. Having .ambientLight in materials giving us more control is great. But it should be optional, and default to the expected value of White...Unless I'm wrong with the definition and purpose of Ambient Light in 3D. I come from 3D modelling (Blender, 3DSMax) and Unreal Engine, where its a set standard. THREE expectedly follows it (jeez their editor is uninviting compared to BJS' playground.) Why is the BJS standard the reverse, using Black? Kosh = Hater of ambiance?! REVEALED!
  9. Phuein

    3D Spaceship Camera

    Thanks! Now the code makes full sense. I'm sure others will enjoy it, too. Cool space example, Sven. Thanks for sharing. Could you add comments to the code? I'm not entirely sure how you chose your logic there. What's focalLength() about? And focalPlane? Why _checkInputs() checks on the ship's worldMatrix? I do generally get that you basically used a rotationQuaternion like coolroar's example, which seems like what's missing from the FreeCamera/UniversalCamera.
  10. Phuein

    Ambient Light Discussion

    Because then you would have to call that for loop every time a new material is applied. The whole point of an ambient light is to avoid tinkering with each material.
  11. Phuein

    3D Spaceship Camera

    I saw the demo, but I'm still not clear on what it does. The 222 multiplier, and why RotationAxisToRef twice? Also, how does the yawPitchRoll function work, in regards to calling RotationAxisToRef three times? Seems mysterious without some explanation.
  12. I'm not sure I'm following your suggestion. Can you provide a PG example? My instinct tells me that moving the world makes no sense. For tracking the player. For other players in the scene. For me trying to make sense of interactions. I saw another post talking about the big numbers, so I'm glad to hear you corroborating it. EDIT: Focusing on the numbers issue, I can see THREE.js solves this by calling on a logdepthbuffer from webgl: var renderer = new THREE.WebGLRenderer({ antialias: true, logarithmicDepthBuffer: true }); Can BJS do this? I tried searching, but only found references to materials; not the renderer. I get the suspicion that this is doable. Further clarification, they have a cool example: Isn't there some way I could just hrmmm round-up my numbers or something? Assure some kind of precision? I tried messing with Math(), but to no avail.
  13. Phuein

    Ambient Light Discussion

    No, an ambient light has no direction. This is not a viable solution, when there are many materials. I would have to keep doing this for every material, instead of relying on an actual ambient light for the whole scene. Also, it falls off the definition of an ambient light; which is the purpose of my op.
  14. Phuein

    Playground Hover @see Links Broken

    That's odd. I tried again with the default demo, and it's working fine. But it definitely did bug-out in another example just yesterday. I remember trying twice. I can't recall the example, though. Guess I'll keep an eye on it, until I can post a specific case. Should have done that. I'll mark as solved, until I do get a bugged example; and considering my other post here as a side-thang.
  15. Phuein

    3D Spaceship Camera

    Please add comments to the functions. Isn't clear [for me] what autoBank does, what's expected. Looks good.