Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:43:07+00:00 2026-06-04T08:43:07+00:00

I was thinking how to do collision detection in my OpenGL application and came

  • 0

I was thinking how to do collision detection in my OpenGL application and came to conclusion that I should keep two copies of my geometry data.

1)First copy : Only for OpenGL rendering purposes.This can be saved as VBO,Vertex Indices.(saved in GPU?)

2)Second copy :I save in client side(in a class ,say 3DEntity) which I perform all tests including bounding-box collision test,ray casting,

So, after I load a mesh data (say from an OBJ file), first I prepare the “first copy” and then using “vertex indices” I prepare the “second copy”.
(For example: If my mesh is a simple cube ,my “first copy” will have 8 vertices,and use Vertex Indices to render it properly.But my “second copy” will have total 36 vertices.Because I have to do ray-casting on triangles)

I keep a transformation matrix inside the “3DEntity” to keep states like Position,Rotation..etc of my “3d Entity”.
So in psuedo code;

class 3DEntity {
 Vertex[] verticesForPhysics;
 Matrix tranformationMatrix;
}

I keep the “verticesForPhysics” values fixed.(Means, its always in model coordinate system).So When I want to move,rotate my entity I simply change “transformationMatrix”.

When doing tests like collision detection , I make a temporary copy of vertices again,by multiplying “verticesForPhysics” by “transformationMatrix” giving the vertices in World coordinates.

Vertex[] verticesForPhysicsInWorld=transformationMatrix * verticesForPhysics;

Now I do my tests using these “verticesForPhysicsInWorld”.

Is this the correct way of handling this ?
I am worried about data redundancy by keeping two copies and making another temporary copy for collision detection tests.
How do other OpenGL game engines handle this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:43:08+00:00Added an answer on June 4, 2026 at 8:43 am

    It is pretty normal to have multiple copies of vertex data, so don’t worry about it 🙂

    For example you might have:

    • Untransformed vertex data that describes your geometry
    • Transformed vertex data during rendering (possibly done by the GPU)
    • Simplified, transformed data used for collision detection (e.g. AABB trees) – this is much more efficient than working with full transformed vertex data for collision detection!
    • When needed, transform the vertex data for more detailed collision detection, but only after you have determined that two objects might be colliding due to AABB overlap. You don’t want to do this for every object every frame!

    Note that it is also common that the vertex data / geometry used for physics is different from that used for rendering. Often you can get away with simpler objects for collision detection (e.g. spheres, cylinders)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well first off I'm surprised actionscript 3.0 doesnt have pixel-based collision detection. Anyways I'm
Was thinking it should be pretty easy to create a ProgressBar that drew some
Thinking about avoiding code replication, I got a question that catches me every time
Thinking that the answer to this is pretty obvious but here it goes: When
Been thinking about this for hours now. Im building a simple slideshow application, where
Just thinking about the best way to build an Order form that would (from
Am I right in thinking that until I am able to afford dedicated servers
I've seen various answers to the ball collision detection question explaining why sqrt operations
If I have a sprite, how would I check collision between two points? For
I'm playing around with OpenGL and I'm finding myself writing code that I feel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.