octree

Octree neighbour search

人盡茶涼 提交于 2019-12-23 22:45:05
问题 I have an octree, that stores a voxel-based fluid. When I simulate the fluid, I need to access the leaves around the current node, how can I implement such a search? You can assume the node stores a pointer to its parent node.(Perhaps other data is needed?) 回答1: Assuming each octree node also holds its 3D index[1] in the octree (and its depth). Generate the 3D indices for the neighbor nodes of the query node (simply increment/decrement the 3D index of the query node in each dimension). For

C++ Branching recursive struct?

南笙酒味 提交于 2019-12-22 05:14:36
问题 I have the following. The struct is prototyped so it compiles fine. struct vertexNodeInfo { vector<vertexNodeInfo> node; }; I'm trying to write an octree thingy. What I want to do is use a recursive function to continue adding a node to each node until I get down to a specific point, at which time the function, rather than adding another node, adds a leaf. I want to use no memory when there's no further node or leaf added if that's possible. Maybe templates would help in this situation, but I

When to use Binary Space Partitioning, Quadtree, Octree?

时光怂恿深爱的人放手 提交于 2019-12-18 09:53:25
问题 I have recently learned about binary space partitioning trees and their application to 3d graphics and collision detection. I have also briefly perused material relating to quadtrees and octrees. When would you use quadtrees over bsp trees, or vice versa? Are they interchangeable? I would be satisfied if I had enough information to fill out a table like this: | BSP | Quadtree | Octree ------------+----------------+------- Situation A | X | | Situation B | | X | Situation C | | | X What are A,

How to delete a node of an octree c++ ( node was 0x4.)

一曲冷凌霜 提交于 2019-12-13 22:00:19
问题 I have an Octree and I have to delete a node searched by it's branch. The program can find the node but I'm struggled with delete it. When I create an object of my Octree and I create some nodes but I don't delete them, then the destructor is delete the Octree : Octree::~Octree() { clear(root); } void Octree::clear(node *node){ for (int i = 0; i < 8; i++) if (node->child[i]) clear(node->child[i]); delete node; } But when I'd like to delete a concrete node with this method, void Octree:

How to iterating a Quad/Oct tree

孤者浪人 提交于 2019-12-07 12:00:58
问题 I am having a difficult time grasping how to iterate an octree or quad. And it may be because I am not experienced with different mythologies of iterating. But let’s suppose that I produced a quad tree that holds float x,y,z; dword color. Now, Let’s also say that this node can only produce 4 children at a time (and those children can both produced 4 children, etc, etc) up until: 7 levels are reached (so that child can’t create anymore children, but its brothers/sisters can), all 4 children

How to iterating a Quad/Oct tree

萝らか妹 提交于 2019-12-05 21:28:51
I am having a difficult time grasping how to iterate an octree or quad. And it may be because I am not experienced with different mythologies of iterating. But let’s suppose that I produced a quad tree that holds float x,y,z; dword color. Now, Let’s also say that this node can only produce 4 children at a time (and those children can both produced 4 children, etc, etc) up until: 7 levels are reached (so that child can’t create anymore children, but its brothers/sisters can), all 4 children created are the same dword color (again, if that happens, its brothers/sisters can still produce), or

Octree raycasting/raytracing - best ray/leaf intersection without recursion

江枫思渺然 提交于 2019-12-04 13:47:34
问题 Could anyone provide a short & sweet explanation (or suggest a good tutorial) on how to cast a ray against a voxel octree without recursion? I have a complex model baked into an octree, and I need to find the best/closest leaf that intersects a ray. A standard drill-down iterative tree walk: Grab the root node Check for intersection No? Exit Yes? Find child that intersects the ray that is closest to the ray's origin Loop until I reach a leaf or exit the tree Always returns a leaf, but in

When to use Binary Space Partitioning, Quadtree, Octree?

左心房为你撑大大i 提交于 2019-11-29 18:42:07
I have recently learned about binary space partitioning trees and their application to 3d graphics and collision detection. I have also briefly perused material relating to quadtrees and octrees. When would you use quadtrees over bsp trees, or vice versa? Are they interchangeable? I would be satisfied if I had enough information to fill out a table like this: | BSP | Quadtree | Octree ------------+----------------+------- Situation A | X | | Situation B | | X | Situation C | | | X What are A, B, and C? Nils Pipenbrinck There is no clear answer to your question. It depends entirely how your

Ray - Octree intersection algorithms

假装没事ソ 提交于 2019-11-28 16:34:32
I'm looking for a good ray-octree intersection algorithm, which gives me the leafs the ray passes through in an iterative way. I'm planning on implementing it on the CPU, since I do not want to dive into CUDA just yet :) At the moment, my Voxel raycaster just does 3D DDA (Amanatides/Woo version) on a non-hierarchic array of XxYxZ voxels. You can imagine that this is pretty costly when there's a lot of empty space, as demonstrated in the following picture (brighter red = more work :) ): I've already figured out that there are two kinds of algorithms for this task: bottom-up , which works from

Ray - Octree intersection algorithms

北城以北 提交于 2019-11-27 19:56:58
问题 I'm looking for a good ray-octree intersection algorithm, which gives me the leafs the ray passes through in an iterative way. I'm planning on implementing it on the CPU, since I do not want to dive into CUDA just yet :) At the moment, my Voxel raycaster just does 3D DDA (Amanatides/Woo version) on a non-hierarchic array of XxYxZ voxels. You can imagine that this is pretty costly when there's a lot of empty space, as demonstrated in the following picture (brighter red = more work :) ): I've