I want to use an octree as an OGL scene representation and I have some moving object in there. I would also like to use this octree to accelerate the collision detection. Is there any good algorithm that gives you the path in octree (all cells/nodes of such path) that a moving object would penetrate?
Assume I have one moving object where I know velocity (so two positions, start of the movement and end of the movement in one frame).
My idea is to simply go through the whole tree and perform collision detection of the cell containing the moving object and the rest of the cells. That would give me all of them but isn't it an overkill?
Thanks!
Octree - what cells does moving object affect?
466 views Asked by Hitokage At
1
There are 1 answers
Related Questions in ALGORITHM
- MCNP 6 - Doubts about cells
- Given partially sorted array of type x<y => first apperance of x comes before first of y, sort in average O(n)
- What is the algorithm behind math.gcd and why it is faster Euclidean algorithm?
- Purpose of last 2 while loops in the merge algorithm of merge sort sorting technique
- Dots and Boxes with apha-beta pruning
- What is the average and worst-case time complexity of my string searching algorithm?
- Building a School Schedule Generator
- TC problem 5-2:how to calculate the probability of the indicator random variable?
- LCA of a binary tree implemented in Python
- Identify the checksum algorithm
- Algorithm for finding a subset of nodes in a weighted connected graph such that the distance between any pair nodes are under a postive number?
- Creating an efficent and time-saving algorithm to find difference between greater than and lesser than combination
- Algorithm to find neighbours of point by distance with no repeats
- Asking code suggestions about data structure and algorithm
- Heap sort with multithreading
Related Questions in OPENGL
- How to fix "Access violation executing location" when using GLFW and GLAD
- getting Access violation writing location when calling glDrawElements caused by shader
- Experimenting with GLFW library: window boundary problem and normalized coordinates
- OpenGL Framebuffer/FBO RTT subpixel movement discrepancy
- Why isn't my glfw window showing anything?
- How can glPushMatrix affect the rotation of an object around a rotating object?
- g++ / vscode apparently cannot see my src folder? "cc1plus.exe: fatal error: src/glad.c No such file or directory"
- Does addition-assignment cause dependency chain in GLSL?
- Compiling C++ program with Opengl and Glut in windows
- Using Silk.NET in WinForms
- What happens when rendering an OpenGL buffer that has been padded with NULL (or another value)?
- How can I make a sphere follow an eight-like path in Python using OpenGL?
- OpenGL only rendering second triangle, first triangle not visible
- OpenGL shows black texture on quad
- My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined
Related Questions in COLLISION-DETECTION
- collision detection in pygame-python
- Trying to spawn n non-colliding sprites; pygame crashing
- Three-mesh-bvh stop drag after collision
- Check collision between 2 arrays
- How do I detect for collisions without immediately resolving them in Godot 3D?
- Trying to destroy prefab upon collision
- how to remove sprite image from screen using pygame.sprite.spritecollide() for coin collection, powerups etc.?
- How to make two kinematic objects in Unity detect overlap?
- How to make collisions with rects in pygame
- Why doesn't my collision detection/update score work on my game?
- How to stop Rigidbody on collision in unity
- Collision Detection works only with two objects
- Detect overlapping elements
- What should I do to debug in Collision Detection?
- resizing bouncing box at edges fails in canvas
Related Questions in COLLISION
- Brick Breaker Ball Bounce
- I am trying to make a Turtle Eater Game and I'm running into a minor bug(kind of)
- Points system in Unity not working. I want to count points but make both objects disappear and it's not working
- How to make wall collision with staticbody2d & collisionshape2d ( using an area2D for player with collisionshape2d as a child ) in GODOT?
- How do you get the numerical values in this collision function
- Pygame slows down after Collision Handling PacMan
- Problem with a wall collision on a map loaded from a png file (like the raylib maze example)
- How to make collisions with rects in pygame
- pygame collisions while character is on a tile
- onCollisionEnter is not working in r3f how can i fix it?
- How to handle collision after a diagonal movement with rectangles
- Inverting a hitbox
- Gamemaker collisions
- Python Pygame Platformer
- Java Ball Movement: Unexpected Behavior with Boundary Reflections
Related Questions in OCTREE
- Raymarching into an octree in wgsl
- How can I declare an enum in wgsl?
- Efficient way of traversing an Octree and doing ray hit intersection in a shader
- instance of parent Class not accessible from subclass? "does not exist in current context"
- Collisions Three.js Octree
- Why does my libigl code using knn take forever to complete?
- Implementation of octree system
- CGAL QuadTree build_with_custom_split based on node bounding box
- Get the tighest bounding box
- How to efficiently store different node types of an octree
- Collision detection with octrees realized with python-fcl
- Octant partition equally a cloud of points in 3D
- How to convert octree to voxel grid with open3d?
- How to properly declare a class member pointer to an array without allocating array
- How to best create an Octree/BVH in GPU memory without pointers?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If you have start and end positions of your moving object, then you have a ray defining your object's motion. A node in your octree is a cuboid, which is a rather simple polyhedron. You can think of collision/intersection tests as ray-cuboid intersection tests.
Check out the object-object intersection algorithms on this page:
http://www.realtimerendering.com/intersections.html#II247
That page points to code on Github for ray-polyhedron intersection:
https://github.com/erich666/GraphicsGems/blob/master/gemsii/RayCPhdron.c
To start with a simple example, assume your object is simply a point traveling along that ray of motion. Then you could find the object's path using ray-cuboid intersection. If a node of the octree doesn't contain the ray, then there's no point in searching deeper into that node's child nodes. (Searching through the entire octree from top to bottom defeats the purpose of creating the octree in the first place.) Even if your objects is a complex thing with numerous vertices, writing the code to do simple ray/cuboid intersection for one point in motion will be instructive.
The computational geometry book Geometric Tools for Computer Graphics by Schneider and Eberly has a nice treatment of line-in-polyhedron intersection, including a page of pseudocode that's easy to understand. If you're going to spend much time coding up 3D geometry, you'll want a copy of that book on your shelf. Eberly also has a number of helpful PDFs on his website:
https://www.geometrictools.com/
If you create your octree such that each node has a pointer to its immediate neighbors, then this may speed up the search a bit. I wouldn't suggest implementing at the start, though--create something simple first rather than tackle multiple implementation tasks at once.
To take a slightly more complicated example, if you have a triangle of 3 vertices oriented so that the triangle's surface normal is parallel to the direction of motion, then intersection tests of the triangle with the cuboid nodes of your octree would be straightforward; test ray-cuboid intersection for rays starting at each vertex and parallel to the direction of motion.
From there your approach may vary depending on the complexity of your moving object and your needs for "collision" detection. For example, you might allow not only an intersection to be considered a collision, but also a very near pass of one object to another. I don't know what your application is, how complex your object may be, whether the object is approximately convex, etc., but you could consider testing collision with the convex hull of the object, or perhaps with a sphere/cube that encompasses all the points in the object.