royibernthal Posted January 7, 2017 Share Posted January 7, 2017 I'd like to draw a custom 3d line using code, i.e. specify an array of points (x,y,z), color and thickness and drawing the line. Is there some sort of API that already does that? If not, how do I achieve that? Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 7, 2017 Share Posted January 7, 2017 Could an extrusion http://babylonjsguide.github.io/intermediate/Parametric_Shapes#extruded-shapes Be used? Am on mobile so cannot do a PG Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 7, 2017 Share Posted January 7, 2017 You can't specify the width of a line in bjs... A workaround could be to use tubes : http://doc.babylonjs.com/tutorials/Parametric_Shapes#the-tube royibernthal 1 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted January 8, 2017 Author Share Posted January 8, 2017 BABYLON.MeshBuilder.CreateLines looks great, any idea why it doesn't support specifying width? Is there a reason behind why it's not a feature or was there just no need for that? As for tubes - interesting workaround - I suppose I'll have to somehow calculate the curve points according to the coordinate points? Or is there a simpler solution? Quote Link to comment Share on other sites More sharing options...
adam Posted January 8, 2017 Share Posted January 8, 2017 5 minutes ago, royibernthal said: I suppose I'll have to somehow calculate the curve points according to the coordinate points? https://github.com/BabylonJS/Babylon.js/blob/aea052a54acb9b97530c87297c40f2823ebbc4f8/src/Math/babylon.math.ts#L3867 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted January 8, 2017 Author Share Posted January 8, 2017 23 minutes ago, adam said: https://github.com/BabylonJS/Babylon.js/blob/aea052a54acb9b97530c87297c40f2823ebbc4f8/src/Math/babylon.math.ts#L3867 This function returns a Curve3 and I need an array of Vector3 to define the curve in the tube. What exactly do these Vector3 in the array represent? Quote Link to comment Share on other sites More sharing options...
adam Posted January 8, 2017 Share Posted January 8, 2017 28 minutes ago, royibernthal said: I need an array of Vector3 to define the curve https://github.com/BabylonJS/Babylon.js/blob/aea052a54acb9b97530c87297c40f2823ebbc4f8/src/Math/babylon.math.ts#L3931 http://doc.babylonjs.com/tutorials/How_to_use_Curve3 http://www.babylonjs-playground.com/#2GCEVH Temechon 1 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted January 8, 2017 Author Share Posted January 8, 2017 What exactly do these Vector3 in the array represent? They're not simple coordinates are they? Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 8, 2017 Share Posted January 8, 2017 As getPoints() suggest they are coordinate points along the defined curve. royibernthal 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted January 8, 2017 Share Posted January 8, 2017 Maybe readings the documentation could help : http://doc.babylonjs.com/tutorials/How_to_use_Curve3 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted January 8, 2017 Author Share Posted January 8, 2017 I see, I was under the wrong impression that I must use curves in a tube (and thus translate my coordinates to curves), my bad. In that case, I can achieve my goal without Curve3. Thank you. JohnK 1 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.