376 questions
Advice
1
vote
7
replies
158
views
Hashlife: what kind of fresh hell am I getting into?
As the title suggests, I'm trying to tackle Hashlife.
Am I jumping in blind? No, well, not entirely.
First thing, I've studied this article concerning GoL:
https://medium.com/@d.dadiani343/how-to-...
6
votes
3
answers
418
views
Find any single 2D point within radius, but fast
I've got a list P of 2-dimensional points, 100 ≤ |P| ≤ 100000, and a list C of circle centers, 100 ≤ |C| ≤ 100000.
All coordinates (x,y) ∈ P or (x,y) ∈ C are integral, 0 ≤ x,y ≤ 4095.
P and C may ...
1
vote
1
answer
152
views
Generic Quad Tree implementation in C
Context
I've been trying to learn C and have become a little more comfortable in it recently. I am building a 2d space shooting game (kind of Galaga inspired, written using SDL) and decided to use ...
0
votes
0
answers
51
views
How to find number of nodes from its leaves? [duplicate]
for a k-ary tree? Why is it 2L - 1 for a binary tree and not 4L - 1 for a quad tree?
0
votes
1
answer
206
views
Rust quadtree implementation
Im trying to make a quadtree implementation in rust that takes as input an Array2<u8>. Any node that contains all the same values should become a leaf. Problem is it just keeps dividing anyway ...
0
votes
1
answer
111
views
How do I enforce a constant 2:1 subdivision from LOD to LOD in a quadtree?
First of all thanks to TARN4T1ON. His recommendation to use boundingBoxes for distance detection helped me to solve my problem.
Now I have a new obstacle.
I want a radially symmetrical gradation of ...
0
votes
0
answers
89
views
How does a recursive quadtree subdivision with concentric circles work?
I have a quadtree and the subdivision currently works with the distance from the camera to the center of a child and the width of the child.
_LODCircles(pos){
const height = pos.y; //...
0
votes
0
answers
117
views
How to handle dynamic objects in a quadtree structure without redrawing the tree each iteration in Python?
I am trying to create a simulation of particles using the Barnes Hut Algorithm. I am representing the particles as a structured array where rows represent particles and the columns represent ...
0
votes
0
answers
308
views
How to implement Conway’s Game of Life using a quadtree in Java?
I am trying to implement Conway’s Game of Life using a quadtree data structure in Java. I have a QuadTree class that stores points in a two-dimensional space, and each point has a Cell object as its ...
1
vote
0
answers
44
views
Finding the cell containing a given point in quadtree recursively
As part of a larger program, I have this function which takes 4 arguments: r, z, c, and grid. r and z represents the coordinates of the point. c is the parent cell for which we first make the check ...
0
votes
0
answers
145
views
Disadvantages to unevenly splitting nodes in a quadtree?
Scenario
I am using a quadtree to store positional data on objects that represent asteroids/planets/stars in a program to model a realistic solar system with realistic distances. The use of a quadtree ...
1
vote
0
answers
63
views
CGAL QuadTree build_with_custom_split based on node bounding box
Following the CGAL's example in the documentation linked below:
[https://doc.cgal.org/latest/Orthtree/Orthtree_2octree_build_with_custom_split_8cpp-example.html][1]
Is it possible for one to run ...
0
votes
0
answers
184
views
How to define the boundary conditions of a rectangle being used in a quadtree to hold points in R^2
I am trying to implement a quadtree to store points in R2. My project requires a square centered at (0,0) with side lengths l, so the quadtree must be able to store all points in the closed rectangle [...
0
votes
0
answers
91
views
Fall of black pixels in a Quadtree
Hello I am trying to create a function Gravity that make all the black pixels of a Quadtree to "fall" if they can (if there is a white pixel under).
for instance Gravity(Qt1) gives Qt2 :
...
1
vote
1
answer
214
views
How do I create an Iterator for a QuadTree that yields each point, the leaf it is in, and the neighbouring leaves?
I have a simple QuadTree. For readability and to help me understand what is happening, It avoids recursion and has a static depth. The QuadTree stores references to the points that are owned by ...
0
votes
0
answers
63
views
Smallest Distance between 2 points in field
I have a set of points denoted by (x y) coordinates in a space with a specified width and height, let's call this set s. Given any point p (p is not necessarily in s), I want to find the point q in s, ...
0
votes
2
answers
134
views
How can I generate a null type in Haskell?
I need to make a Quadtree in Haskell. But I never used the language before. As I understand, there is no null pointers in Haskell. So how could I instantiate a null version of Group for the pointers ...
0
votes
1
answer
87
views
segmentation fault when passing a double pointer in a recursive function
I have this simple code that is supposed to create a quadtree.
/* here is my quadtree struct */
typedef struct QuadTree {
AABB *boundry;
Point **points;
struct QuadTree** NW;
struct ...
-1
votes
1
answer
103
views
Weird issue with a quadtree implementation in C++
Below is the script for the quadtree... I'm relatively new to the concept of pointers, so my guess is that I have done something wrong with a double pointer, or something along those lines!
#include &...
1
vote
1
answer
309
views
Flutter Flame - Performant Radar Mechanism
Assumed we would like to create a strategy game. What is the best way (using flutter together with the flame engine) to detect other units (e.g. enemies) around an element?
I've checked out the ...
0
votes
1
answer
389
views
Implementation of a quadtree in java using recursion function for counting compressed numbers
I faced "java.lang.StackOverflowError", while doing recursion method.
Basically, I am solving quad compression algorithm problem.
Problem is
In Solution class, there is a solution method, ...
1
vote
1
answer
915
views
Implementing a simple quad tree for searching points within a rectangle
I am trying to implement a a quad tree with the very basic functionality of inserting points and then querying it to find all points that lie within a specific rectangle.
I've referenced this for my ...
-2
votes
2
answers
244
views
How to determine which points (x,y) out of million data points lie inside the area described by a rectangle (x1, x2, y1, y2)?
I need to figure out how to check if certain points lie inside or outside a rectangle given as coordinates (x1,x2,y1,y2) i.e. top left and bottom right points of rectangle. The total number of points ...
2
votes
1
answer
378
views
Returning a mutable reference to a field of a mutably referenced struct
I am still quite new to the advanced topics in rust, but for context, I am trying to implement a generic quadtree in rust.
With the method find_mut(&mut self,x,y) I want to traverse the quadtree ...
2
votes
1
answer
499
views
How do I make this recursive function faster? (Quadtree)
I'm learning C++ and am doing something I'm comfortable with in java to start out. Particle simulation and flocking using a quadtree to cheaply find particles in a region. Everything is working but ...
0
votes
0
answers
97
views
More Efficient Way of Calculating Population from Data Grid and overlapping Polygon?
folks! Apologies if this is a duplicate question and I've done some research on the topic but don't know if I'm heading in the right direction.
I have converted gridded data of population density to ...
1
vote
1
answer
859
views
Best way to calculate nearest neighbour on a set of constantly moving xy coordinates OpenCV Python?
So I am using OpenCV to do some object tracking. What I have so far is a script that finds good points to track
in this video
What I would like to now do is draw lines between the points, however I ...
0
votes
1
answer
651
views
Find the size/level of a node from its position within an quadtree
I have a quadtree. The root node (level 0) is positioned at 0,0 by its centre. It has a width of 16, so its corners are at -8,-8 and 8,8. Since it's a quadtree, the root contains four children, each ...
0
votes
0
answers
90
views
Reconstructing a quad tree from a depth-first traversal
I've been working on a decoder that reconstructs data encoded as a depth-first traversal of a quad tree structure. When I encode the offset of each, its pretty simple.
deconstructed_matrix = np.empty([...
1
vote
1
answer
221
views
Algorithmic advice: Identify points that are "near" a line out of a set of points
Given is a finite 2-dimensional continuous space, a set of points s from that space and a line l: y = mx + b through that space.
I want to filter out all points in s whose shortest distance from l is ...
1
vote
1
answer
363
views
Neighbor finding of multiple quadtree
I need some help with this problem I'm having of how to do Neighbor find of multiple quadtrees.
I have a cube. Each side of the cube is made of N individually colored quads (as you can see from the ...
1
vote
1
answer
312
views
What is wrong with this recursive quadtree/subdivision algorithm?
this function is supposed to find if there is above a set number of points within the window, and if there is draw a rectangle around it and then subdivide by recursively calling the same function on ...
1
vote
0
answers
109
views
Add Depth to Each Instance's Quadtree Nodes
How can I modify the code shown below to apply different depth level of quadtree to each instance contained in the image. I would like to apply a finer quadtree level on instances such as the 'teddy ...
0
votes
1
answer
1k
views
Concatenating arrays of different sizes
I am trying to do a quadtree algorithm on numpy array of points created by make_blobs function from sklearn. I am trying to create an Recursive Partition KMeans in which the centroids are found in ...
2
votes
1
answer
392
views
How can I represent a Quad Tree as a Binary Tree?
As stated in the title, how can I represent a quad-tree as a binary tree? I know that it is possible to represent general trees as binary trees but I wasn't able to wrap my head around binary tree ...
1
vote
0
answers
235
views
Correctly managing pointers in C++ Quadtree implementation
I'm working on a C++ quadtree implementation for collision detection. I tried to adapt this Java implementation to C++ by using pointers; namely, storing the child nodes of each node as Node pointers (...
4
votes
3
answers
3k
views
Can a quad-tree be used to accurately determine the closest object to a point?
I have a list of coordinates and I need to find the closest coordinate to a specific point which I'll call P.
At first I tried to just calculate the distance from each coordinate to P, but this is too ...
0
votes
1
answer
84
views
Validate number sequence as quadkey (not just regex)
I know quadkeys have the basic regex of [0-3]{6,23}.
But is it possible for a number to match that regex and not be a quadkey?
I.e. random number 2010210202020021
Given a random number, I would like ...
0
votes
1
answer
93
views
How to free all memory blocks of a picture using quadree structure with different cases?
Few weeks ago, I was trying to implement a function to display a quadtree. My current problem is concerning the same work, so I pass you this link for all the context: How to display composed ...
0
votes
1
answer
439
views
How to display composed quadtrees using C language?
Currently I’m trying to implement different functions to realize operations on quadtrees using C language.
Context:
A quadtree (black and white picture) is:
White
Black
Is broken down into 4 sub-...
0
votes
1
answer
113
views
Examples of quadtrees with datasets
I don’t know if this is the right place to write about my question. However my question is this: I’m trying to find examples of quadtree implementations using real datasets. The only ones I find ...
-1
votes
1
answer
266
views
Trying to find leaf nodes in a Quadtree (C++) [closed]
I am making a Quadtree in C++. I need to find the leaf nodes of the tree. To do this I have this function that needs to return a vector of the leaf nodes. For now everything else seems to work, but ...
3
votes
0
answers
111
views
How to separate hundreds of moving circles
How do I separate N number of moving circles? I am making a small game where I have hundreds of moving circles colliding. I have them all stored in a qTree, which I recreate every frame. The collision ...
0
votes
2
answers
1k
views
How would I use S2 in a Yelp or Uber service?
Let's say I have a list of restaurants and I have the location of a customer that's looking for restaurants that are nearby. How could I use S2?
From my understanding without S2, I would maintain my ...
0
votes
1
answer
651
views
Why a quadtree sometimes need a max number to hold in a node?
I am doing a compuational geometric issue which uses TriangularMeshQuadtree from a C# library, and some of its constructors is written as follows (from metadata, so I cannot see the details of ...
2
votes
0
answers
192
views
Barnes-Hut algoritm insertion center of mass shift
I'm having trouble understanding how inserting into a Barnes-Hut quadtree works. If the root represents the center of mass and all of nodes within the quadtree, what happens if you insert something ...
0
votes
0
answers
207
views
How to solve memory problem of a quadtree with moving objects?
I am creating a quadtree for a 2D game in C# to make the rendering faster. Some of the objects (planets) are moving and that is why, I created a method called removeAndUpdate to update the tree by ...
2
votes
1
answer
166
views
Why this Quadtree Query often returns nothing?
Any "W" refers to half-width and any "H" refers to half-height. Any "X" and "Y" refers to the center of a rectangle aligned with the co-ordinate axes.
I am ...
0
votes
1
answer
503
views
Why has my quadtree made no improvement to performance?
I have a boids flocking simulation setup. It originally worked by having every boid loop through every boid so that they all constantly know where each other are at in order to tell if they are close ...
1
vote
1
answer
1k
views
How to determine the optimal capacity for Quadtree subdivision?
I've created a flocking simulation using Boid's algorithm and have integrated a quadtree for optimization. Boids are inserted into the quadtree if the quadtree has not yet met its boid capacity. If ...