Jump to content

  • Log In with Google      Sign In   
  • Create Account


AABB transforming


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Richard Goodrum   Members   -  Reputation: 107

Like
0Likes
Like

Posted 14 February 2012 - 09:52 AM

Hi I've managed to implement a bounding box using Assimp and opengl by finding the smallest and highest x,y,z position, and these are shown correctly. However, I have attempted to update the boxes by finding all corners and multiplying it by the object's transformation matrix, and then finding the minimum and maximum x, y, z values of these corners. But when I try this I get really small values that are too small to be detected for collisions. I have checked the multiplication of the vector and the matrix but everything seems okay, is there something I'm missing?

Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 11906

Like
1Likes
Like

Posted 14 February 2012 - 12:24 PM

I am afraid you have a bug. Set up a specific example with numbers that are easy to think about and a simple transform, do the math on paper and then compare with what your program does under a debugger.

#3 Richard Goodrum   Members   -  Reputation: 107

Like
0Likes
Like

Posted 15 February 2012 - 06:29 AM

I managed to work out what was wrong after creating a box and printing results to the screen. Basically, each time the render function was being called the transformation matrix was multiplying each corner over and over, making the boxes move further away constantly. I fixed it by setting a start minimum and maximum and setting these first when updating. Thanks for the advice!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS