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
    Senior Member Regular Contributor
    Join Date
    Apr 2012
    Posts
    318
    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?

Similar Threads

  1. Replies: 7
    Last Post: 02-28-2016, 02:21 PM
  2. vertex array object not bound .. opengl core 4.1
    By pacific_00 in forum OpenGL: macOS
    Replies: 5
    Last Post: 04-10-2015, 11:48 PM
  3. Placing scaled/rotated item in world coords
    By morello in forum OpenGL: General
    Replies: 2
    Last Post: 12-01-2010, 12:30 AM
  4. Using scaled general meshes for physics
    By MichiB in forum COLLADA
    Replies: 3
    Last Post: 10-27-2009, 06:14 PM
  5. Distance scaled point sprites
    By LaBasX2 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-15-2007, 02:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean