Jump to content

Advice and cooperation about GeometryBuilder


Recommended Posts

 hi all members.

i have design pattern for make a new geometry builder in my mind and i make a some test but wanna do it in teamwork 

we can talk about all depended stuff of geometry and find a good way to do that :)


Link to comment
Share on other sites

Cool.  Hi Naz!  Good to see you again.  Good to see GeometryBuilder being developed and shared... THANK YOU, NAZ!

Allow me to flesh this topic a little bit: 

Forum posts about GeometryBuilder:  http://www.html5gamedevs.com/search/?&q=geometrybuilder&type=forums_topic&nodes=16,28,29,30,31

Question #1: Do the links @ http://www.html5gamedevs.com/topic/21929-geometric-modeling-kernel/?do=findComment&comment=125297  ...still work?

Question #2a:  Why is GB (geometryBuilder) so slow?  Caused by shaderBuilder load-in time... for certain GeometryBuilder demos?

Question #2b:  Even slower on mobile?

Question #3:  GB seems to use some SVG.  Will this limit certain devices?

GB (GeometryBuilder) appears to cast its result... as a BABYLON.Mesh.  This makes it compatible with everything BJS, so I see no problems, there.  Standard vertexData, afaik.

@Pryme8 spurred Naz to build GeometryBuilder with this post.  P8 mentioned "independent geometry kernel" (huh?)... and then showed us a very interesting link.  It might be beyond the scope of JS... to accomplish Open Cascade functionality.  As Pryme8 mentioned, it is a "pipe dream" of his.  :D 

These advanced geometry libraries and methods seem less-than-friendly.  That is expected.  I think GeometryBuilder will be the same.  I love the potential POWER of GB.  I am scared of the "making it useful for anyone" - part.  :)  GB is certainly interesting and innovative.  When and where to use it?  I think the future will tell.  Party on!

Link to comment
Share on other sites

answer for question 1 : i fixed that my server in iran have dns problem :)

answer for q2 and q3 :




all 60 fps : Iphone 5s and mac pro 13" retina dispaly :)

q4 : we need path parser anyway and this is just a helper for find a points


http://www.babylonjs-playground.com/#FT2RY#68 this is 44 fps in iphone 5s and 60 in mac pro 

have 36 building 

Link to comment
Share on other sites

Beautiful!  Thanks for the answers.  SVG available on most mobile devices?  Works for me.

Possible to cap the buildings, Naz?  (thx)

Caps could also be used as floors (many) inside the buildings, too, I suppose.

Link to comment
Share on other sites

i wanna tell my design pattern for geometry builder.

1. we need calculate vertex places and keep it in arrays or 'array of array' or any structure we need

2. we most push vertex step by step and make face with Uv and push it in original instance in each step 

3. need make a geometry or Mesh (almost babylonjs mesh instance)



Link to comment
Share on other sites

let me explain sample 1 :

i have some method like

face3 : make 3 point face

geometrybase : give my points and build face step by step

geometryInstance : make babylonjs  geometry 

var PlanBuilder = function (op) { 

   // for add face and vertex in main array 
    var builder = function (pre, geo) {
        face(geo, pre.p1, pre.p2, pre.p3, pre.p4);
        face(geo, pre.p1, pre.p2, pre.p3, pre.p4, { flip: 1 });

    if (def(op.end)) {

    return new geometryInstance( geometryBase(op, builder, op.custom) );

we define PlanBuilder first and use it for make geometry

	   p1: { x: -1., y: 0., z: -1 },
	   p2: { x: -1., y: 0., z: 1 },
	   p3: { x: 1., y: 0., z: -1 },
	   p4: { x: 1., y: 0., z: 1 },  




Link to comment
Share on other sites

for more step : Use like recursive function :

    var sampleGeo = function (op) {  
       var builder = function (p, geo) {
		   var i = p.i;
		   if (i > 3) { 
				// calculate points per step			  
				  var p1 = { x: sin(i)*5.  , y: cos(i)*5.  , z:-2.};
				  var p2 = { x: sin(i-1)*5., y: cos(i-1)*5.   , z:2.};
				  var p3 = { x: sin(i-2)*5., y: cos(i-2)*5.  , z:2.};
				  var p4 = { x: sin(i-3)*5., y: cos(i-3)*5.   , z:-2.}; 
                 // make face
				  face(geo, p1,  p2,  p3,  p4);
				  face(geo,  p1,  p2,  p3,  p4, { flip: 1 }); 
		  if (i < 5.) {  // finish condition 
					  p.i+=0.5; // go next step
					  p.builderRef(p,geo ); // recursive function
    var geo =  geometryBase({  i:0, builderRef: builder }, builder ); 
    return new  geometryInstance(geo); 




i think we need define just Builder and Use it Like Pattern 


Link to comment
Share on other sites

Wingy plays a bit:  http://playground.babylonjs.com/#179VAS#1

Nothing new or exciting... but I did wash and vacuum the playground a bit.  ;) 

nazpak.js... your one-stop file... for ALL your NasimiAsl experimenting needs.  :)   Naz, let me know if you have issue with my (temporary?) republishing of your libs.  I will delete nazpak.js if you wish, no problems.  I just wanted a cleaner/smaller playground to play-in (and smaller to store in the playground db).  Use it in your future PG demos, too, if you like.

Edit:  Actually, that playground IS exciting, but Naz made it that way, not Wingy.  This is all I've done, as far as coding GB, but it's a start, right?  heh

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.

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.


  • Recently Browsing   0 members

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