Jump to content

Draw a triangle mesh on both sides


Tyrahell
 Share

Recommended Posts

Hi there,
 
Im looking for a property to draw a triangle mesh on both side. Atm my code only draw the face coolinear to the normal. Any tips ?

function drawTriangle(scene) {  	//Let's create a mesh for our element:  var triangle = new BABYLON.Mesh('triangle', scene);	//Then, the points for the triangle element:  var positions = [    0, 1, 0,    -1, -1, 0,    1, -1, 0  ];	//Next, we create the normals (orientation):  var normals = [    1, 1, 1,    1, 1, 1,    1, 1, 1  ];	//And the indices, for the points order:  var indices = [];  indices.push(0);  indices.push(1);  indices.push(2);	//Finally, we load everything in our mesh:  triangle.setVerticesData(positions, BABYLON.VertexBuffer.PositionKind, true);  triangle.setVerticesData(normals, BABYLON.VertexBuffer.NormalKind, true);  triangle.setIndices(indices);  return triangle;}

++Tyrahell

Link to comment
Share on other sites

Yes, backfaceculling has been in Babylon for the year or so that I've been messing with it, but I thought DK told me that double sided meshes weren't supported and no plans to support it. Pretty sure that setting BFC to false just made my face black instead of transparent, and didn't show the texture. That was... months ago from blender exports though.

 

I would love it if double sided meshes were supported. I have a lot of meshes that are like... the sail of a ship that I will have to duplicate the faces for just to show the texture on both sides.

Link to comment
Share on other sites

yea... looks like three.js is playing some tricks to support it.

 

 

Looks like there's a "simple" fix for this in 3DS Max...

 

Just use shell on the surface that you want to make double sided, then set the thickness down to 0.

http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/index.html?url=files/GUID-E38BD284-3283-4311-AC29-3F699B2F04AA.htm,topicNumber=d30e96227

 

Inner/Outer Amount

Distance in 3ds Max generic units by which the inner surface is moved inward and the outer surface is moved outward from their original positions. Defaults=0.0 / 1.0.

 

The sum of the two Amount settings determines the thickness of the object's shell, as well as the default width of the edges. If you set both to 0, the resultant shell has no thickness, and resembles an object set to display as 2-sided.

 

Maybe an option in the exporter to "make 2 sided" for 3DS Max which just applies a shell to the object and sets the inner/outer to 0?

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...