Search the Community
Showing results for tags 'createlines'.
-
Assign a material to a mesh created using CreateLines
rainerpl posted a topic in Questions & Answers
Hi, I created a mesh using CreateLines function. The function works as it should, but the lines are drawn white. I tried giving it a material, but it throws an error, telling me there is no setter. I tried modifying using mesh.material.setColor3 and 4 and other properties, but they had no effect. How can i change the color of the lines. And also give the lines some shading, just like wireframe materials do. PS: i cant use regular mesh with wireframe material because it creates triangles and adds extra lines. E.g if i draw a square face, then wireframe view shows diagonals too.( like 2 triangles ) -
Hi guys, I'm having troubles drawing some lines out of a Vector3 array with MeshBuilder.CreateLines / Mesh.CreateLines.. I've seen many examples of drawing lines in various playgrounds e.g. http://www.babylonjs-playground.com/#1DKDYG#0 - http://www.babylonjs-playground.com/#RF9W9 However, when I try to use these examples in my environment I get the following error: Uncaught TypeError: Cannot set property isPickable of #<i> which has only a getter i @ babylon.2.3.js:5 r @ babylon.2.3.js:10 i @ babylon.2.3.js:18 createScene @ LineScene.js:93 <- my awesome babylon scene :P I was not able to reproduce this error in the playground, the part of my code which causes the error: .. // shape var shape = [ new BABYLON.Vector3(1, 0, 0), new BABYLON.Vector3(0.2, 0.3, 0), new BABYLON.Vector3(0, 1, 0), new BABYLON.Vector3(-0.2, 0.3, 0), new BABYLON.Vector3(-1, 0, 0), new BABYLON.Vector3(-0.2, -0.3, 0), new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(0.2, -0.3, 0), ]; shape.push(shape[0]); //this doesn't work var shapeline = BABYLON.MeshBuilder.CreateLines("sl", {points: shape}, scene); //neither does this //var shapeline = BABYLON.Mesh.CreateLines("sl", shape, scene); .. The rest of the code is only the creation of a simple scene from the very basic Babylon getting started tutorial and is working fine when I remove the CreateLines. Any ideas what I'm doing wrong? Cheers, Lesterhaus
- 4 replies
-
- typeerror
- createlines
-
(and 2 more)
Tagged with: