Jump to content
  • Advertisement
Sign in to follow this  
Prune

OpenGL Export curves from Maya to use in OpenGL program?

This topic is 4073 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to export a curve, say spline, from Maya, as a series of vertices so that I can then load it into my OpenGL program and use as an animation curve? Note that I don't mean the curve control points and parameters, but a series of vertices of the already tessellated curve.

Share this post


Link to post
Share on other sites
Advertisement
Sure ... just be aware it's easy to make your animation curve data massive this way =)

Use MFnNurbsCurve::getPointAtParam, and iterate param from 0 to 1 using a step that corresponds to the resolution you want to subdivide the curve with.

If you're using a variable time step, you could implement an error metric to only export points after the maximum error from the last point exported exceeds some maximum (with a little bit of cleverness to keep an eye on how close you are to the end of the curve).




Share this post


Link to post
Share on other sites
Oddly enough, I ended up needing to pull some curve data out of Maya myself the other day, and I realised I had the parameterisation wrong last time. The curve is actually parameterised from 0 to n (where n is the number of CVs on the curve). It's worth noting thata NURBS curve in Maya has 2 more CVs than you actually create yourself (these extra end points define the tangency of the actual end points you create). So, you'll actually want to pull the data out from 0 to (n - 2).

[Edited by - Milkshake on July 30, 2007 1:54:02 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!