wandersonp Posted September 15, 2014 Share Posted September 15, 2014 Hey guys, how can I transform individual points in gdp im using that fragment, but is deprecated in H13 xform.translate(0.0, 1.0, 0.0); position *= xform; gdp->points()[0]->setPos3(position); Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted September 15, 2014 Share Posted September 15, 2014 (edited) first, get an attribute handler: GA_RWHandleV3 ph(gdp->getP()); then iterate on points like this: GA_FOR_ALL_PTOFF(gdp, ptoff) { UT_Vector3 newpos = ph.get(ptoff) * matrix; ph.set(ptoff, newpos); } Edited September 15, 2014 by Stalkerx777 Quote Link to comment Share on other sites More sharing options...
wandersonp Posted September 15, 2014 Author Share Posted September 15, 2014 Thanks a lot Alexey. thats were very helpful Quote Link to comment Share on other sites More sharing options...
edward Posted September 16, 2014 Share Posted September 16, 2014 For positions, one can just use the getPos3() and setPos3() methods without need an attribute handler because there's already one built-in. So the simplest code would be: UT_Vector3 pos; GA_Offset ptoff = gdp->pointOffset(0); // offset to first point pos = gdp->getPos3(ptoff); xform.translate(0.0, 1.0, 0.0); pos *= xform; gdp->setPos3(ptoff, pos); Quote Link to comment Share on other sites More sharing options...
edward Posted September 16, 2014 Share Posted September 16, 2014 PS. The porting guide has lots of examples http://www.sidefx.com/docs/hdk13.0/_h_d_k__g_a__porting.html Quote Link to comment Share on other sites More sharing options...
wandersonp Posted September 16, 2014 Author Share Posted September 16, 2014 Thanks a lot edward 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.