hi , I still don’t know when will the NURBS Module ready for for Away3d 4…
Desperately Need Cubic Bezier Path/Cubic Bezier Surface & NURBS Support !!!Software: Away3D 4.x |
||
|
||
Greg Caldwell (Greg209), Administrator
Posted: 28 June 2011 10:22 AM Total Posts: 45 [ # 1 ] Hi, I’m planning on porting/re-implementing the patches and NURBS from 3.6 but haven’t had much chance recently. It’s definitely on the TODO list but I’ll need to have a think about the best way to do this, to try and take advantage of the GPU if I can. It may have to be a port first followed by a re-factor. Greg
|
||
kurono, Sr. Member
Posted: 06 October 2012 12:44 PM Total Posts: 103 [ # 2 ] Last day played around with Greg’s NURBS code and tried to write kinda port for Away4. All the necessary classes are attached. Usage:
var controlNet:Array = [ And small code I’ve made to build mesh from set of vertices and faces.
public function buildMesh(rawVerts:Vector.<Number>, rawFaces:Vector.<uint>, rawUVs:Vector.<Number> = null):Mesh { File Attachments nurbs.zip (File Size: 3KB - Downloads: 431) |
||
80prozent, Sr. Member
Posted: 06 October 2012 03:00 PM Total Posts: 430 [ # 3 ] Hi i changed the rawFaces of the NURBSbuilder.as into this, and it seams to work:
public function get rawFaces():Vector.<uint> { hope that works for you too.
|
||
|
||
80prozent, Sr. Member
Posted: 06 October 2012 03:51 PM Total Posts: 430 [ # 5 ] no problem. i do not not fully understand this class yet, but i believe it could be optimizied to produce meshes with much smaller verticles-count. as it is right now, each triangle produces 3 verticles, while they really could share them. you could reduce the verticle-count by using the weld function afterwards, but i think welding the mesh while producing it, would be much more effiecient. anyway, i allways liked the bezier nurbs classes for their smooth looking meshes, and i am more than 80% happy to see some of it finaly coming to away3d 4.
|
||
|
||
Greg Caldwell (Greg209), Administrator
Posted: 07 October 2012 06:54 PM Total Posts: 45 [ # 7 ] Nice one guys!! Sorry I haven’t got around to it before you - other things have taken priority - not really a good excuse I know. Glad you got it working. I’m definitely looking into the feasibility of a GPU based NURBS implementation by pushing part of the creation to the GPU and not just the mesh rendering, to improve the whole process. I’ll also look into getting a direct port integrated into main repo. Greg
|
||
80prozent, Sr. Member
Posted: 07 October 2012 08:42 PM Total Posts: 430 [ # 8 ] hi greg one question about the GPU calculation stuff. would this be the basic workflow for this? - calculate number of verticles and create vertexbuffer. i am trying to understand how this would work, so it would be great to know if i am theoretical on the right way…
|
||
Greg Caldwell (Greg209), Administrator
Posted: 09 October 2012 12:28 PM Total Posts: 45 [ # 9 ] Hey guys, You’ve got me interested in those NURBS again so I took a go at re-working the NURBS for 4.0. As a result, there is now a class available in the 4.1 dev branch on GitHub. Check it out and let me know if it works okay for you. I’ve posted a quick demo at : http://bit.ly/OQp5Lx This shows 40x40 segment NURBS geometry that is also animated by shifting the 3 of the control points. Also includes a ball moving across the surface. Let me know what you think. @80prozent, in terms of GPU calcs, there are a number of options but principally yes, my first approach will be to send pre-sized vertex/index buffers to the GPU and let the shaders do the calcs to push the vertices in the correct place. The current animated NURBS in the demo require a vertices upload between frames - which starts to slow down when the meshes are large. Sorry I didn’t get around to it sooner. Greg
|