Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to get the position of a vertex in a model?

Author
Message
Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 10th Dec 2008 06:14
I want to know the world position of a vertex of a model in real time such that I can cast a ray from this vertex position to another vertex position to check collision with other objects.

The model that I use has an axe as part of the whole model. And the model has animations. So the axe will change its position in game play. I want to use raycasting to check for collision. But I don't know the positions of the vertex. I've tried using vertexdata but I can't lock the model with limb 0 or 1 or 2...so I can't get vertex position... Any other method to this?

Thanks.
Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 10th Dec 2008 10:15
After doing some experiment, I found out that locking my model with limb 3 can succeed in locking the model. The total number of vertex count is 1617.
But the problem is that what the vertex number seen in the modeling package and the vertex number get in the game engine do not match each other. The position of a vertex differs.
I also try to minus 1 and plus 1 to the vertex number, but the vertex number is still different to each other.

So my question is how to get the correct vertex number in a 3d modeling software that match the vertex number in DarkGDK?

Any solution?

Note: I use fragMOTION for viewing the x model.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th Dec 2008 05:16
I'm thinkning that that you might find that starting at limb zero (whole model) is where you'd have to start to match your 3d software. This is a guess.. however real world position of a vertex might require first getting the world position of the limb (think there is a function for that) then applying the vertex coordinates + rotation + limb position to get world position.

just a guess

--Jason

Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 13th Dec 2008 15:34
Thanks, Jason.
You have reminded me that I can get the limb# of the weapon and get its position and direction. So I don't need to get vertex data anymore.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Dec 2008 20:22

Login to post a reply

Server time is: 2024-09-30 13:23:18
Your offset time is: 2024-09-30 13:23:18