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?
464 Views Asked by Hitokage At
1
There are 1 best solutions below
Related Questions in ALGORITHM
- Two different numbers in an array which their sum equals to a given value
- Given two arrays of positive numbers, re-arrange them to form a resulting array, resulting array contains the elements in the same given sequence
- Time complexity of the algorithm?
- Find a MST in O(V+E) Time in a Graph
- Why k and l for LSH used for approximate nearest neighbours?
- How to count the number of ways of choosing of k equal substrings from a List L(the list of All Substrings)
- Issues with reversing the linkedlist
- Finding first non-repeating number in integer array
- Finding average of an array
- How to check for duplicates with less time in a list over 9000 elements by python
- How to pick a number based on probability?
- Insertion Sort help in javascript -- Khan Academy
- Developing a Checkers (Draughts) engine, how to begin?
- Can Bellman-Ford algorithm be used to find shorthest path on a graph with only positive edges?
- What is the function for the KMP Failure Algorithm?
Related Questions in OPENGL
- setting OpenGL version in objective-C
- How to run OpenGL version 3.3 (with Intel HD 4000) on Ubuntu 15.04
- Can linear filtering be used for an FBO blit of an MSAA texture to non-MSAA texture?
- How to get shader version from QOpenGLShader?
- "Capture GPU Frame" in XCode -- iOS only?
- Difference between glewGetString(GLEW_VERSION) and glewIsSupported
- Tesselation result flickering - OpenGL/GLSL
- Water rendering in opengl
- Texture mapping consuming physical memory
- Rotating a Cube using Quaternions in PyOpenGL
- Switching from perspective orthographic projection in OpenGL
- FreeType2 and OpenGL : Use unicode
- Should Meshes with and without Skeleton use different Shaders?
- How to get accurate 3D depth from 2D screen mouse click for large scale object in OpenGL?
- Trying to load 2d texture with glTexImage2D, but just getting blank
Related Questions in COLLISION-DETECTION
- simple collision detection for edge animate program
- Collison Detection between two point clouds using PCL
- Math/Physics: Given angle and vector find point of intersection?
- How to check for collisions in ThreeJS?
- javafx collision issue between path(line) with thick stroke and circle
- ThreeJS collisions with SAT missaligned collision boxes
- isInside not working for btConvexHullShape of Bullet Physics library
- Swift: score increases twice because collision is detected twice?
- C# XNA Collision Detection with list of objects
- Collision Detection with an NSMutable array of Objects
- Partial Collision Error
- cocos2d-x: can not create callback from onContactBegin
- LibGDX - Tilemap Wall Collision Detection issues
- Collision detection between rectangles (no overlap) - libgdx
- Collision detection between two rectangles in java
Related Questions in COLLISION
- How to check collision if only bottom half of the sprite matters (think of a cherry with a stem)
- unity 2D 5.0: collision with colliders, one with "is trigger" checked and one with "is trigger" unchecked
- How to check for collisions in ThreeJS?
- Java Game Development- Sprites colliding?
- didBeginContact logic OSX swift
- Removing items from ArrayList upon collision (Java)?
- Unity3D Play sound from particle
- Sticky Collisions
- Side Collisions
- Always a Collision
- How can I detect a specific 3d model collision three.js
- Collision detection between rectangles (no overlap) - libgdx
- Libgdx - collisions between two moving circles
- Collision between a line and a face
- c# XNA collesion slows movement
Related Questions in OCTREE
- Fast volume representation, modification and polygonisation
- Only upper right part of image rendered when using octree
- Why does my libigl code using knn take forever to complete?
- Collisions Three.js Octree
- QuadTree or Octree templatized implementation in C++
- Next iteration in z-order curve
- PCL GPU Octree implementation is slow
- How to best create an Octree/BVH in GPU memory without pointers?
- Access type flag of unknown void pointer based on two possible structs?
- Querying the octree
- Test if Cube is inside Sphere - Fastest Method
- Octree - what cells does moving object affect?
- How to efficiently store different node types of an octree
- OcTree method in Matlab
- How to sort overlapping octree positions
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)
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?
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.