Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: How do I calculate box bound collision between two scaled items in openGL?

  1. #1
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2

    How do I calculate box bound collision between two scaled items in openGL?

    Both of the items are using different scales (e.g. item 1 = gl.glScalef(.25f, .25f, 1f) where as item 2 = gl.glScalef(.10f, .10f, 1f))

    For detecting the collision between the two items, am I correct in assuming for the width and height values I use the scaled values ?? e.g. for item 1, the width is .25f?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jun 2012
    Posts
    207
    Quote Originally Posted by drenner View Post
    Both of the items are using different scales (e.g. item 1 = gl.glScalef(.25f, .25f, 1f) where as item 2 = gl.glScalef(.10f, .10f, 1f))

    For detecting the collision between the two items, am I correct in assuming for the width and height values I use the scaled values ?? e.g. for item 1, the width is .25f?
    You can retrieve modelview matrix by glGet() and then multiply it with vertex coordinates. Dont forget that matrix will be coloumn major.

  3. #3
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2
    Quote Originally Posted by debonair View Post
    You can retrieve modelview matrix by glGet() and then multiply it with vertex coordinates. Dont forget that matrix will be coloumn major.
    Sadly I am new to OpenGL thus I don't know what you mean, if I provided you with my rendering class would you be able to show me?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •