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.

DLL Talk / ppMeshList and they world position...How to acces them ?

Author
Message
Hotline
11
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 16th Sep 2011 12:34 Edited at: 16th Sep 2011 17:06
oops sorry for the mistake in the post title but i can't edit the title text so:

ppMeshList and THEIR world position...How to access them ?



I'm working on the collision system for SPARK wrapper and i want to calculate the object AABB based on the object vertices
There will be 2 vectors (AABB.min and AABB.max)
But each time i get the vertexData pointer and read the positions of the vertices i get wrong positions (assuming that vertexPositions are not world positions) i tried it in dbpro and get the same wrong results with the vertexdata commands too (LOCK VERTEXDATA FOR LIMB and so on...)


then i figured out if i add the limb positions to the vertex positions i get the correct worldpos.



The question is how to access the mesh global positions ?

here's a part of a code for explanation :



Thanks !


EDIT: Just found out thats not correct ... so i need the transform matrix because of the rotation and scale... but i can't find them... any ideas about this ?

Brendy boy
14
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 17th Sep 2011 00:15
sFrame *frame=objectPTR->ppFrameList[limb_index];
sMesh *mesh=frame->pMesh;
use frame->matAbsoluteWorld matrix to transform vertex local position to world position

Hotline
11
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 17th Sep 2011 11:37
Hey Brendy boy thank You very very much ! Finally it works as it should

Regards

Hotline
11
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 18th Sep 2011 00:34 Edited at: 19th Sep 2011 12:38
Hmm... i can return the correct values from a matrix
but cant use thems in my code ???

This works (returns the limb's offset):




but this won't...




THIS IS REALLY CONFUSING !
The weird thing i got my octree system working in 90%
and still wasting time with this DX nonsense ?
any suggestion ?

EDIT : If an object is positioned scaled or rotated the sync must be called to update the matrix... which makes the matAbsoluteWorld useless to me

Login to post a reply

Server time is: 2019-10-15 10:32:18
Your offset time is: 2019-10-15 10:32:18