THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/03/2010 at 17:49, xxxxxxxx wrote:
okay .. 100% might have been a bit over zealous. I've got rotations working properly, but now I am having an issue with position.
firstSelection->SetPos((opMatrix * polyLocation));
to set where the object will sit on the polygon (the center).
however, I get this...
I want for it to look like this...
You can see in the second image that the smaller cube is sitting so that the face is right against the polygon of the larger cube. THis is the result I am looking for.
I have tried adding the radius of the smaller cube to the position of the smaller cube but this only works correctly if the object is a cube, otherwise I get some funky results.
Is there a better way to get the postition of the cube to rest polygon to polygon. For example, could I temporarily change the axis of the smaller cube so that when I change the position of the smaller cube, the axis is at the outer edge, and then after I have changed the postiiton, change the axis back.. Is this possible?
How would I change the axis of a polygon object? I have looked at SetModelingAxis() but am not sure how I would use it...
Any help would be greatly appreciated.
Thanks a lot.