Quote: "none of the above works for dbpro's primitives sphere and cylinder"
This was the bit I didn't know and thought I was doing something wrong. So avoid using these, cheers
I was wonder if there was something wrong with my code but it returns correctly:
_faceHit = SC_GetFaceHit()
rotate xyz matrix4 _rotationMat, degToRad(object angle x(1)), degToRad(object angle y(1)), degToRad(object angle z(1))
translate matrix4 _transMat, object position x(1), object position y(1), object position z(1)
multiply matrix4 _worldMat, _rotationMat, _transMat
lock vertexdata for limb 1,0
vert = _faceHit * 3
for null = 0 to 2
_vector3.x = memblock float( 1 , (vert+null) * _memVertSize + 12 )
_vector3.y = memblock float( 1 , (vert+null) * _memVertSize + 16 )
_vector3.z = memblock float( 1 , (vert+null) * _memVertSize + 20 )
set vector3 _vertPosition, _vector3.x, _vector3.y, _vector3.z
transform coords vector3 _transVertPosition, _vertPosition, _worldMat
_vertTemp(null).x = x vector3(_transVertPosition)
_vertTemp(null).y = y vector3(_transVertPosition)
_vertTemp(null).z = z vector3(_transVertPosition)
next
unlock vertexdata
The main problem I'm having is working out the barycentric coordinates because I have no clue how you would account for flipped ploys if you call it that. Take a box for instance, the sides are arranged differently to the top. Is there anyway to account for this?
@chafari, cheers and I've actually looked at that method before. Though actually I never had a problem with getting them, I wasn't sure why it wasn't working on everything I used it on.
"Get in the Van!" - Van B