Questions tagged [octree]

An octree is a tree data structure in which each node has eight child nodes. A major application of octrees is in 3d graphics as they are the primary structure used for storing voxel (volumetric pixel) data.

Wikipedia: "An octree is a tree data structure in which each internal node has exactly eight children. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees."

Relevant topics include voxels and color quantization.
For more information see http://en.wikipedia.org/wiki/Octree

148 questions
1
vote
1 answer

Generalized (non-slicing) pointer to templated tree nodes? (C++)

I'm working on an octree implementation where the tree nodes are templated with their dimensional length (as a power of 2): template struct node_t { enum { DIM = 1 << N }; node_t * parent; node_t * children[8]; long…
ben_reilly
  • 11
  • 3
1
vote
0 answers

Voxelization of a Scene with Instanced Objects

I have created a simple scene in directx11 that has a plane as a floor, with several spheres, cubes and rectangular walls. There is only 3 objects loaded: a plane, cube and sphere; but the cube and sphere are instanced several times with different…
1
vote
1 answer

Get image top 10 colors

I am generating color pallete for image through octree quantization. Its gives me maximum 256 colors for any image. Now i want to show only top 10 ( according to the quantity of color in image ) colors of the image out of these 256 colors. How can i…
Tom Rider
  • 2,747
  • 7
  • 42
  • 65
1
vote
2 answers

How to use a quad/oct tree for a block world

I have been messing around with octrees and quadtrees for the past couple of days. I can build them, iterate them, and spit out information that I need. I also know they are very useful in collision detection, where you take the screen and…
User
  • 659
  • 2
  • 12
  • 29
1
vote
2 answers

Barnes Hut worst case memory scenario

I want to run a Barnes Hut N-body simulation (Wikipedia article). I know how much memory a single node of the octree will occupy, but I can't figure out what a worst case memory usage scenario would be for a given number of particles. In short, I'm…
Void Star
  • 2,401
  • 4
  • 32
  • 57
1
vote
1 answer

Different behaviour between opencl c99 and c++ with the same implementation of a realtime voxel raycaster

I am working with opencl to develop a voxel raycasting engine. I am trying to do something similar to Gigavoxels by Crassin. In this paper, they are using an octree to store the voxel data. For the moment I am just trying to descend inside the…
valeriodidonato
  • 129
  • 1
  • 1
  • 9
1
vote
2 answers

Performance of positioning voxels in an octree/quadtree

This is something I've been thinking about for the past couple hours. This is a mind exercise. So I learned what octrees were today! Very interesting! I've been thinking through how to implement an octree that resolved to a voxel. My biggest issue…
Nathan Goings
  • 1,145
  • 1
  • 15
  • 33
0
votes
1 answer

Concerning Octrees

I am creating a Minecraft like terrain engine thing, and I was wondering what exactly octrees are. With my engine I have seperated each part of it into chunks or regions - which from what I have read has something to do with it. Also, I was…
Darestium
  • 643
  • 2
  • 11
  • 29
0
votes
1 answer

Implementation of octree system

I have been trying for some time to implement an octree system in a class project aimed at 3D image rendering optimization. But I always block in the implementation of this one, indeed I have a basic class center that I must adapt to an octree…
Lvs17
  • 1
0
votes
1 answer

Get the tighest bounding box

I think the code is self explanatory: // Set the bbox min and max of the lower node current_min_bound = lower_get_bbox_min(buf, lower_handle); current_max_bound = lower_get_bbox_max(buf, lower_handle); // Set lower node bbox if(current_min_bound.x…
0
votes
1 answer

Collision detection with octrees realized with python-fcl

I want to finish the collision detection with point cloud represented by Octrees. With the python-fcl lib, I tried the following code snippet by myself x = np.random.random([5, 3]) y = np.random.random([5, 3]) object1 =…
0
votes
0 answers

Raytracing octree gets wrong intersection with negative directions

I'm trying to implement a GPU raytracer that traverses an octree given it's AABB. I'm using "An Efficient Parametric Algorithm for Octree Traversal" as my basis for this project. During the implementation, I found some problems with negative…
0
votes
1 answer

How to properly declare a class member pointer to an array without allocating array

I am new to C++ and trying to create my first Octree structure. Common way to store children is simply to store 8 pointers in each node. like so: class Octant { Octant *child0; Octant *child1; Octant *child2; //... } This means each…
0
votes
0 answers

PCL GPU Octree implementation is slow

I want to use pcl::gpu::Octree for storing the obstacle map and retrieving the closest distance to a given point. I've modified an official test example as follows: int main(int argc, char** argv){ using namespace pcl::gpu; …
GPrathap
  • 7,336
  • 7
  • 65
  • 83
0
votes
1 answer

Printing an element from an octree with cout alters the content?

I tried creating an octree in c++. Seems to work fairly well, but when I print the content of the tree it returns an access violation error. Running this in debug will print two different numbers, although the content should not have been changed.…