jerome

Members
  • Content count

    2,939
  • Joined

  • Last visited

  • Days Won

    66

jerome last won the day on February 9

jerome had the most liked content!

6 Followers

About jerome

  • Rank
    Advanced Member
  • Birthday 03/17/1970

Contact Methods

  • Website URL
    http://jerome.bousquie.fr/BJS/demos/

Profile Information

  • Gender
    Male
  • Location
    France / Rodez

Recent Profile Visitors

2,186 profile views
  1. I would recommend to systematically use the command line : "gulp typescript" what makes plenty of tests and build the library for you. Moreover, it's updated by the core team each time some internal dependencies are added, so you don't have to care about all this stuff. [EDIT] now I use VSCODE editor for linux what works out-of-the-box with typescript and BJS
  2. Understood ... What I would do personally : - to have a chuncked logical representation of the whole world (its geometry) - to have a single big SPS displaying only what is visible on the screen, say 3000 particles - to make the logical world "slide" under the SPS in function of the user movement, to pass it the current visible data from the current chunk and to update its particle according to these current data Well, this is just my point of view and I'm quite sure to keep a decent FPS, to achieve to manage it with a SPS and deal with huge amount of memory required from your massive data
  3. Hi, I still don't know what you're trying to achieve, I mean in concrete terms, something that could start from a PG prototype, so it's not easy to tell that one SPS is better than 10, or the contrary. Wrong ... here's a very simple code using updateParticle() like explained in the doc : 10K cylinders and 200 of them updated per frame at 60 fps http://www.babylonjs-playground.com/#VHJYX#6 1000 updated / 10K : http://www.babylonjs-playground.com/#VHJYX#7 3000 / 10K : http://www.babylonjs-playground.com/#VHJYX#8 The error in your code is that you manually re-iterate over the whole pool of particles when setParticles()/updateParticle() already do it for you. Please take the time to read the doc, everything is explained. Temechon had another project with thousands of trees in a landscape, I can't remember the link
  4. Well, basically and whatever the mean used (billboard, lookAt(), rotationFromAxis() ), if you want to rotate the mesh in the World space, you need to describe your rotation constraints. Ex : the mesh z-axis must be the mesh-cam axis, the mesh y axis must be in the plane cam_axis O Y_world_axis, etc (or not). Those are your own choices according to the liberty you want to let to the camera movements. The more camera movement possibiliies, the less rotation constraints possible (or the more "unexpected" mesh rotations necessary). The other way would be to quit the 3D world and to project directly your mesh in the 2D projected space, what sprites and canvas2d do... but they only manage planar meshes (sprite quads or canvas quad) afaik. I'm afraid there's no provided way to display directly a 3D mesh in the 2D space. I personally would define my own constraints along the mesh local system : how should the mesh local x,y,z axis be set from the current camera position ? And then I would just define from the camera and mesh positions these 3 orientated axis with simple cross products (say mesh z axis is the mesh-cam vector) and use RotationFromAxis() to compute the required mesh rotation : https://github.com/BabylonJS/Documentation/blob/master/content/overviews/Standard/How_Rotations_and_Translations_Work.md (if it works ...)
  5. I guess that DK meant sps.mesh.setEnabled(false) The right question is : what do you intend to do exactly ? You seemed to want to use something like a 3js bufferGeometry what is not dynamically updatable at the subpart level and you talked about a static height field from what I initially understood. Maybe I'm wrong. But I don't really get what you really want to achieve. Please let us know and we'll enjoy to drive you in the right direction. Not sure you need more than one SPS. The SPS allows you to update one particle, several particles, all the particles at will : on some event or condition, each frame (milllions vertices each frame will probably be too much for the CPU anyway), or when you want. The philosophy is to call setParticles() to update the particles, or setParticles(first, last) to update them only from the first one to the last one. This can be called when you want, once or as many time you want. What does it do ? it gets each particle logical status (position, rotation, color, uvs, bbox, etc) and computes it into the SPS global mesh geometry, updates this one for the next rendering. You can set each particle logical status by your own, just by accessing to sps.particles ... or better : setParticles() calls for you, within its loop the function sps.updateParticle(p) So can put all your particle logic in this function directly, this is the fastest way to do things Please have a read at this : http://doc.babylonjs.com/overviews/solid_particle_system and let us know what is not clear for you. Check also these demos : - 3000 spherical (well, morphed) drops in a SPS colliding another SPS (torus knots) http://www.babylonjs.com/Demos/Facets/ - 1200 different polyhedrons (SPS) colliding a sphere mesh : http://www.babylonjs.com/Demos/SPSCollisions/ - 80K random buildings : http://www.babylonjs-playground.com/#2FPT1A#36 - 20K boxes and only some moving : http://www.babylonjs-playground.com/#16SA9C#9 - asteroids (immutable SPS) : http://jerome.bousquie.fr/BJS/demos/solidparticlesAsteroid.html or http://www.babylonjs.com/Demos/SPS/ - 5000 updated textured boxes : http://www.babylonjs-playground.com/#2FPT1A#91 A user named chicagobob123 did a project with 15000 container trucks some months ago (can't retrieve his demo). I know Iiceman and Temechon did also pro projects about hexagonal tiled terrains with the SPS some time ago.
  6. same with some random update : http://www.babylonjs-playground.com/#VHJYX#1
  7. let's go... here are 10K cylinders (all updatable if needed) running at 60 fps in my chrome : http://www.babylonjs-playground.com/#VHJYX#0
  8. Curve3.CreateCatmullRomSpline(points, nbPoints) is now in the core and documented : https://github.com/BabylonJS/Documentation/blob/master/content/tutorials/03_Advanced/How_to_use_Curve3.md
  9. the SPS is a big mesh so it behaves like a mesh : one world matrix, one global culling. You don't need to update all the SPS parts (particles) each frame, you can update only the required ones and only when you need what is quite performant in this case : setParticles(i, i) => updates only the i-th particle You can also set/otientate all your particles only once at the world creation for instance and make an immutable SPS is nothing evolves then... or set everything once with an updatable SPS and then just update the very needed part. Several people on this forum made games with a world based SPS like Iiceman or Temechon as far as I remember. Can't you reproduce a short prototype of what you're dong in the playground and telling us what you would expect from it so we could maybe help you ?
  10. Like we don't really know what you're trying to achieve, or don't have a 3JS working example to what compare it, it's not easy to help you ...
  11. +1 The SPS can be seen as the equivalent of the 3JS BufferGeometry.
  12. PRed : https://github.com/BabylonJS/Babylon.js/pull/1791 Thanks to @BitOfGold whose PG helped me to code it quickly As the title says ... var points = [vec1, vec2, vec2, ... vecN]; // the points the curve must pass through var nbPoints = 20; BABYLON.Curve3.CreateCatmullRomSpline(points, nbPoints); documentation coming soon ...