GERDE Posted March 30, 2016 Share Posted March 30, 2016 Hello I have a problem with "enableEdgesRendering" from "createLines". When I activate the function several imaginary line connects to the middle of my ground. When this function is not activate lines are displayed correctly. See attached files, I have print screen. Have a nice day. Germain Quote Link to comment Share on other sites More sharing options...
OMAR Posted March 30, 2016 Share Posted March 30, 2016 Hi @GERDE! First off, I am not really experienced with uhm... mesh.enableEdgesRendering(); What I think about it though, I think mesh.enableEdgesRendering() is commonly used with objects with "faces" specifically, with cubes for example or even planes (they all have faces!). Here in docs it explains itself very well: BABYLON.EdgesRenderer is a tool used to render edges on top of a mesh. Edges are rendered between two faces if the dot product of their normals is less than epsilon. So I think you need "faces" to have edges in the first place, and since lines don't have faces at all, using enableEdgesRendering() on them is not really uhh... productive? Correct me if I'm wrong Edit: Maybe you can create a little Playground Demo to demonstrate your problem? Quote Link to comment Share on other sites More sharing options...
GERDE Posted March 30, 2016 Author Share Posted March 30, 2016 An example http://www.babylonjs-playground.com/#1OLKMJ#1 Comment and decomment the line 77 I would like use "enableEdgesRendering()" for adjust the thickness of a line EDIT: I don't want these 2 lines that point to the middle of my ground... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 30, 2016 Share Posted March 30, 2016 LineMesh is not supposed to work with Edges rendering as it needs faces to work GERDE 1 Quote Link to comment Share on other sites More sharing options...
GERDE Posted March 30, 2016 Author Share Posted March 30, 2016 Is there another way to manage the thickness and color for a mesh.createLines ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 30, 2016 Share Posted March 30, 2016 Unfortunately no..unless using ribbons GERDE 1 Quote Link to comment Share on other sites More sharing options...
GERDE Posted April 1, 2016 Author Share Posted April 1, 2016 Ok thx Deltakosh Have a nice day Quote Link to comment Share on other sites More sharing options...
GERDE Posted April 1, 2016 Author Share Posted April 1, 2016 Hello, I'm completely blocked.... I can't link 2 meshes with Ribbons. I don't know how to do it. I use mesh.position to know the position of the meshes. Please help me Quote Link to comment Share on other sites More sharing options...
jerome Posted April 1, 2016 Share Posted April 1, 2016 no PG ? ok, let's assume you've got mesh1 and mesh2 you could, say, set a first array with var path1 = [mesh1.position, mesh2.position] you could then set another array path2, with some vector3 shifted from the mesh positions of the thickness you want example : shift +2 on x var v1 = mesh1.position.add(new BABYLON.Vector3(2, 0, 0)); var v2 = mesh2.position.add(new BABYLON.Vector3(2, 0, 0)); var path2 = [v1, v2]; this will give you the needed pathArray for your ribbon var pathArray = [ path1, path2 ]; then maybe you should display this ribbon in BILLBOARD mode so it ever faces the camera [EDIT] : http://www.babylonjs-playground.com/#1OLKMJ#2 line 74, change the thickness value you can obviously center the ribbon better than I, say, by shifting its first path by -thickness / 2 and its second one by +thickness / 2 GERDE 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 1, 2016 Share Posted April 1, 2016 Hi Gerde/DK/Jerome/all! @GERDE - there is a topic on the forum named "cylinder between two points" that would likely be helpful. Will your lines always we STRAIGHT lines? Or do you need some curves in the lines? There was a friendly chap named Alby here on the forum for some time. (You might want to read his posts.) He needed text written on the sides of his "thing between two points"... and we did lots of work on his project.... trying to get that text to be long and thin, and trying to get it 'billboarded' (text always faces camera). It may be worthwhile to read his threads and see his playgrounds. To save yourself from possible high vertex counts with tubes and cylinders, maybe a square line (made from a box). But tubes can be square, too, and with minimum path points, they can be low-vertex count. As a quick addition to what Jerome has said... ribbons and tubes are built using similar methods. They both use "path". Jerome might need to verify this, but I think a ribbon is just one "side" of a 3-or-more-sided tube. Using the tube, you won't need to concern yourself with billboarding (making the "face" of the ribbon always face the camera, no matter the viewing angle). Using a scaled cylinder, scaled box, or 3+ sided tube, your connecting line will always have thickness, no matter the viewing angle. Did I say all this correctly, experts? I hope so. Be well! GERDE 1 Quote Link to comment Share on other sites More sharing options...
GERDE Posted April 5, 2016 Author Share Posted April 5, 2016 Thanks thanks I could solve my problem. 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.