Seba Posted January 10, 2019 Share Posted January 10, 2019 Hello I get some black parts on custom shapes created with BABYLON.MeshBuilder.ExtrudeShape Here is my code (this.points is an array of Vector2): if (!this._shapeInScene) { let points: Array<BABYLON.Vector3>; let path: Array<BABYLON.Vector3>; let color: BABYLON.Color4; // points = new Array<BABYLON.Vector3>(); for (let p of this.points) { points.push(new BABYLON.Vector3(p.x, p.y, this.plan.planCenter.y)); } points.push(points[0]); path = new Array<BABYLON.Vector3>(); path.push(new BABYLON.Vector3(0, 0, 0)); path.push(new BABYLON.Vector3(0, this.height, 0)); this._shapeInScene = BABYLON.MeshBuilder.ExtrudeShape( this.name, { shape: points, path: path, sideOrientation: BABYLON.Mesh.DOUBLESIDE, updatable: true, cap: BABYLON.Mesh.CAP_END } ); color = new BABYLON.Color4(this.color.r / 255, this.color.g / 255, this.color.b / 255, 1); this.colors = new Array<number>(); var positions = this._shapeInScene.getVerticesData(BABYLON.VertexBuffer.PositionKind); this.positions = []; for(var p = 0; p < positions.length; p++) { this.positions.push(positions[p]); } for(var p = 0; p < positions.length / 3; p++) { this.colors.push(color.r, color.g, color.b, color.a); } this._shapeInScene.hasVertexAlpha = true; this._shapeInScene.setVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors); } And here a screenshot of my issue : And my question is what could be the reason of this issue? Maybe my points in my Vector2 Array are not sorted properly? Here an exemple on a babylon playground: https://www.babylonjs-playground.com/#HG7TAS Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 11, 2019 Share Posted January 11, 2019 @Seba Hi. Please post it to the new forum https://forum.babylonjs.com/ Quote Link to comment Share on other sites More sharing options...
Seba Posted January 11, 2019 Author Share Posted January 11, 2019 OK I will do that thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.