IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Actor Vertices, Actor Vertices
Lucas Simão
post Nov 5 2009, 10:48 PM
Post #1


Member
**

Group: Members
Posts: 6
Joined: 3-November 09
Member No.: 9,747



There is some way to determine the vertices of the meshs of a actor?
Go to the top of the page
 
+Quote Post
stillDesign
post Nov 6 2009, 05:07 AM
Post #2


Advanced Member
***

Group: Members
Posts: 54
Joined: 18-April 08
From: New Zealand
Member No.: 5,024



When you say 'meshs of a actor', do you mean any NxTriangleMeshShape or NxConvexShape shapes on an actor?

If so;
Get the shape(s): actor->getShapes()[ x ]
Cast it to the right type

For triangle mesh shape;
Call triangleMesh = shape.getTriangleMesh()
Then desc = triangleMesh.saveToDesc
Then iterate from 0 to desc.numVertices-1, and call NxVec3* vertex = ((NxVec3*)desc.points)[ i ] to get each vertex position.
Don't forget about the point stride size smile.gif

Same deal for convex mesh
Go to the top of the page
 
+Quote Post
Lucas Simão
post Nov 6 2009, 03:08 PM
Post #3


Member
**

Group: Members
Posts: 6
Joined: 3-November 09
Member No.: 9,747



QUOTE (stillDesign @ Nov 6 2009, 05:07 AM) *
When you say 'meshs of a actor', do you mean any NxTriangleMeshShape or NxConvexShape shapes on an actor?

If so;
Get the shape(s): actor->getShapes()[ x ]
Cast it to the right type

For triangle mesh shape;
Call triangleMesh = shape.getTriangleMesh()
Then desc = triangleMesh.saveToDesc
Then iterate from 0 to desc.numVertices-1, and call NxVec3* vertex = ((NxVec3*)desc.points)[ i ] to get each vertex position.
Don't forget about the point stride size smile.gif

Same deal for convex mesh


Thanks stillDesign! It's a NxConvexShape. I got to obtain the points. But, the points returned of the vertices are local to the actor. How i can to translate from local points to global points in the space??
Go to the top of the page
 
+Quote Post
stillDesign
post Nov 14 2009, 12:04 AM
Post #4


Advanced Member
***

Group: Members
Posts: 54
Joined: 18-April 08
From: New Zealand
Member No.: 5,024



QUOTE (Lucas Simão @ Nov 7 2009, 04:08 AM) *
Thanks stillDesign! It's a NxConvexShape. I got to obtain the points. But, the points returned of the vertices are local to the actor. How i can to translate from local points to global points in the space??


True,

To transform the points to an actors global space, just multiply each point by the actors global pose:
foreach point
Vec3 worldPoint = Vec3.Transform(point, actor->getGlobalPose() )
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Copyright © 2008 NVIDIA® Corporation.  Terms of Use | Legal Info | Privacy Policy Time is now: 24th November 2009 - 01:28 AM