Skip to main content
12 events
when toggle format what by license comment
May 22, 2023 at 12:02 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Dec 7, 2022 at 18:11 comment added Žarko Tomičić Yes correct, my bad, just the model matrix. So I am looking at this book, authors name is Christer Ericson, about collision detection. Is this ok book, do you even know about it?
Dec 7, 2022 at 17:20 comment added DMGregory No view matrix here, because collisions do not depend on where the camera is looking.
Dec 7, 2022 at 16:41 answer added Vaillancourt timeline score: 1
Dec 7, 2022 at 16:22 comment added Žarko Tomičić I don't think I was clear. So, I know that I should check the distance of the sphere center from the cube. That part is clear. But the rest of your explanation is welcome, although somewhat unclear. So when you say that I would transform sphere center into cube coordinate system, do you mean the coordinate system in which cube center is at its origin and cube sides are parallel to ones defined by coordinate system axis? So I would actually need to apply inverse of a view*model matrix and apply it on the sphere center, and I already know cube vertices in this coordinate system?
Dec 7, 2022 at 15:15 comment added DMGregory You usually would not process cube-sphere collisions using individual vertices and faces. You'd transform the sphere's center into the cube's coordinate system using the world-to-local matrix you have CPU-side, clamp this to the closest point on the cube using its size in each dimension, then compare the distance to the sphere's radius. If less, you can take the closest point you computer as the contact. OpenGL is not involved in any step of that process. Where have you encountered difficulty implementing this?
Dec 7, 2022 at 11:36 comment added Vaillancourt Ah, well you keep a transformation matrix for each of your objects which is used to transform it from local frame to global frame! Each frame, the transform will be updated based on physics, and the matrix will be uploaded to the GPU so that the vertices can be drawn at the right place.
Dec 7, 2022 at 11:03 comment added Žarko Tomičić I am, I am trying to do it on the cpu but as I said, I don't know how is it done in practice, regarding how to get the data about where in space collision objects are exactly...
Dec 7, 2022 at 11:02 comment added Vaillancourt Why don't you do the collision detection on the cpu?
Dec 7, 2022 at 9:34 history edited Kromster CC BY-SA 4.0
added 3 characters in body
S Dec 7, 2022 at 8:17 review First questions
Dec 7, 2022 at 9:09
S Dec 7, 2022 at 8:17 history asked Žarko Tomičić CC BY-SA 4.0