Jump to content

Issue with translation of grid material


masterdon
 Share

Recommended Posts

Hi Everyone,

I have created a grid using GridMaterial on box mesh. the issue is, the grid isn't coming complete. Its broken on all the edges(see the snapshot). i.e. no boundary lines to wrap everything in rectangle. i have also tried setting uOffset and voffset on material however its not working. what am i missing here?

 

Here is my code:

var gridBox = BABYLON.MeshBuilder.CreateBox("box1", { width: objectProperties.width-1, height: 0.05, depth: objectProperties.height + 1, updatable: true }, scene);
gridBox.position = new BABYLON.Vector3(objectProperties.left + startFromLeftPosition + objectProperties.width / 2 - horizontalSlotHeight / 2, 10.05, startFromTopPosition - (objectProperties.top + (i > 0 ? 8 : 7)));

var defaultGridMaterial = new BABYLON.GridMaterial("default", scene);
defaultGridMaterial.majorUnitFrequency = 0;
defaultGridMaterial.minorUnitVisibility = 0.1;
defaultGridMaterial.gridRatio = 1;
//defaultGridMaterial.uOffset = 0.5;
//defaultGridMaterial.vOffset = 0.5;
gridBox.material = defaultGridMaterial;
gridBox.material.alpha = 0.5;

 

2017-09-11_08-47-51.png

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