Jump to content

Calculation of draw calls


Ahiru
 Share

Recommended Posts

I tried already before (was my first idea) - but nothing is shown: http://www.babylonjs-playground.com/#CTHIE#6

 

Your example uses "CreateBox" again, ignoring, that I only have the min and max Verticex to create the box. (I know - I could write a function that calculates from there the center and scaling-factors and create a box and scale and move it around - and use the RenderEdges function in the end, because the wireframe splits the faces of the cube, wich is not intended)

 

But I liked it to see that there seemed an easy way to build a box with 2 Vertices only: - only the 3 draw calls for the bounding box are irritating and makes it slow in the end :(

var min_coordinates = new BABYLON.Vector3(-4, -10, -2);var max_coordinates = new BABYLON.Vector3(20, 1, 10);var custombb_mesh = new BABYLON.Mesh("custom_boundingbox", scene);var vertexdata = new BABYLON.VertexData();vertexdata.indices = [];vertexdata.positions = [	min_coordinates.x, min_coordinates.y, min_coordinates.z,	max_coordinates.x, max_coordinates.y, max_coordinates.z];vertexdata.applyToMesh(custombb_mesh);custombb_mesh.showBoundingBox = true;
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...