AlbertoBonn Posted February 13, 2014 Share Posted February 13, 2014 Hello World,does anybody know how I can extrude splines with babylon.jsgreetz from germany!Alberto Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 16, 2014 Share Posted February 16, 2014 Hello could you elaborate a bit more? (BTW I love your avatar ) How are represented your splines ? Quote Link to comment Share on other sites More sharing options...
AlbertoBonn Posted February 17, 2014 Author Share Posted February 17, 2014 thx 4 the praiseSplines are intresting to create tweens (e.g.:moving cam) or build shapes to extrude.Define splines with vectors, nurbs or importing svg or font types (e.g. ttf). With three.js you can define a curve:spline = new THREE.SplineCurve3([new THREE.Vector3(0, 0, 0),new THREE.Vector3(0, 200, 0),new THREE.Vector3(150, 150, 0),new THREE.Vector3(150, 50, 0),new THREE.Vector3(250, 100, 0),new THREE.Vector3(250, 300, 0)]);An another clever way are formulas to create splines/meshes:THREE.Curves = {};THREE.Curves.HeartCurve = THREE.Curve.create(function(s) { this.scale = (s === undefined) ? 5 : s;},function(t) { t *= 2 * Math.PI; var tx = 16 * Math.pow(Math.sin(t), 3); ty = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t), tz = 0; return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);});By this method you can do complex things with few lines of code.You find more infos about splines and extrusion under the following links:http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Editing/Duplicating/Extrude Formular demo on google Decorative Knot Patternshttp://de.wikipedia.org/wiki/Extrusion_%28Geometrie%29 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 17, 2014 Share Posted February 17, 2014 So given a curve you want to extrude it but along which axis? it will create a flat mesh right? Quote Link to comment Share on other sites More sharing options...
AlbertoBonn Posted February 20, 2014 Author Share Posted February 20, 2014 extrude a line you got a plane, extrude a plane you got a cube. But how you can do it with babylon.js Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2014 Share Posted February 21, 2014 No way to do that right now but I find it really interesting. I can add it to the roadmap unless someone wants to implement it! Quote Link to comment Share on other sites More sharing options...
AlbertoBonn Posted February 22, 2014 Author Share Posted February 22, 2014 Quote Link to comment Share on other sites More sharing options...
Feldspar Posted February 28, 2014 Share Posted February 28, 2014 I implemented a basic extrusion method, based on poly2tri.js. I will do a pull request within the next few days.There is no spline support unfortunately, but you can extrude points along a path, so with some discretization on your part, it will do the trick GameMonetize 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.