Jump to content

3d map with 3d buildings


maca134
 Share

Recommended Posts

So im pretty new to babylonjs, getting my head around most of it but i wanted to ask for some "good practices" advice.

 

Im creating a map preview for a game, i have the actual map working nicely but wanted to know the best way to create 1000s of small, cuboid shapes to represent buildings.

 

I found when i simply dumped the meshes on the map, fps dropped massively. 

 

Are there any existing approaches to this kind of problem around?

 

Cheers

Link to comment
Share on other sites

Hi maca and welcome to the forum. :)

 

Did you already have a look at octrees (http://www.babylonjs.com/?OCTREE) and instances (http://www.babylonjs.com/?INSTANCES)? That should help you creating alot of meshes. Let us know how it is working for you.

 

Maybe you could create a playground (www.babylonjs-playground.com) to illustrate the fps drop and people can help you directly by editing your code and playing around with it.

Link to comment
Share on other sites

disappearing when cam too close ?

I just can't reproduce the problem here.

 

Maybe is it a matter of the mesh bounding box size (just. In this case you could set this size once like explained here : http://www.html5gamedevs.com/topic/15255-is-it-possible-to-set-the-size-of-the-bounding-box/?p=86456

 

In the last PG example, the bounding box size could be (1500, 10, 1500) for instance. You could check it by displaying the debug layer and mark the "bounding box" menu.

Link to comment
Share on other sites

Hi Maca... welcome to the forum.  I see the issue.  It seems to be caused by a problem or characteristic with the freeCamera.  I changed to an ArcRotate, and no more disappearing parti-buildings.  :)  http://www.babylonjs-playground.com/#V78LI#4

 

I'll try to put some time into figuring out why this is happening... soon.  Others will, too.  Be well.

 

I'm sure Jerome has started on the newest SPS feature... you know... groundHeight-sensing particle-positioning with automatic mountain and water avoidance.  ;)   Yep, we're beginning a whole new world of particle positioning funcs.  Might just as well (mizewell) start collecting them, because there will be 100 various SPS positioning funcs by the end of the year.  :D  You know, cloud shaped, spherical, pyramidal, stack-o-boxes, bowl-o-cheerios, etc.  Oooh, how about a positioner that accepts a 3D model, and then places the PSP particles in the shape of the volume of that model?  wow!  3dsMax has an 'array' thing that is very similar to one of these positioners (stacker/spreader/distributor).  Sounds like farming gear, eh?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...