PDA

View Full Version : How do I calculate box bound collision between two scaled items in openGL?



drenner
11-25-2013, 08:47 AM
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?

debonair
11-26-2013, 12:39 AM
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.

drenner
11-26-2013, 12:54 PM
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?