Questions tagged [quadtree]

A quadtree is a geometric data structure for storing points in two-dimensional space. Quadtrees recursively partition a space into four quadrants.

380 questions
0
votes
0 answers

What are efficient ways to store millions of tuples in memory in Python?

I am trying to parse multiple large .txt files (in fact .xyz files) which are containing xyz coordinates. Each file has got millions of lines in it, where each line is presenting one coordinate (xyz) separated by a comma. I only want to keep certain…
conste
  • 390
  • 1
  • 4
  • 16
0
votes
1 answer

Quad tree recursive retrieve

I am creating a quadtree and I get in some trouble with the retrieve function. This function gets down to the nodes that store objects and puts the objects in a vector called relevantObjects. After this, it returns the relevantObjects vector. But,…
marete
  • 3
  • 1
0
votes
1 answer

alternative methods are used for location searches on dating sites other than quadtrees?

I got quadtrees working on a swingers site I have been building. But I wondered what other equally powerful approaches there would be to searching based on location. I havn't bee able to find much about this.
0
votes
1 answer

How to mix normal and quadtree-based collision detection?

I have a quadtree set up for all static collision objects, which works great for both collision detection and raycasting However, as I also have non-static collision objects, when I raycast I'd like to include them as possible collidable objects for…
Ben Ezard
  • 463
  • 6
  • 18
0
votes
0 answers

StackOverFlowError quadtree insert

I want to implement insert method for a quadtree. In this quadtree i will insert certain shapes like rectangle, triangle, circle and diamond. All shaoes come with an rectangle border(all shaoes are considered rectangles in this method). My method…
RobertD
  • 25
  • 6
0
votes
0 answers

getPixel Function Runtime - Quadtree Data Structure (C++)

so for a class I am supposed to create a function that gets a pixel given an x and y value from a node in my Quadtree, and in this case it represents and PNG image. This function needs to be O(logn). I am just looking for suggestions on how I could…
Gonez
  • 26
  • 3
0
votes
1 answer

Preorder traversal of a quadtree

So I know for a binary tree the general way to preorder traverse it is like this void displayPreOrder(TreeNode node) { if(node != null) { displayPreorder(node.left); displayPreorder(node.right); …
user3469915
0
votes
1 answer

Problems understanding quadtrees

I am interested in the datastructure "quadtree" and for an project of mine, i want to use them. Ok lets make an example : We have a 3D space where the cameraposition is locked but i can rotate the camera. Whenever i rotate my camera to a certain…
greedsin
  • 1,252
  • 1
  • 24
  • 49
0
votes
1 answer

Javafx rectangles in quadtree won't dissappear/be created - using mouseevents

I've made a program that creates a simple visual quadtree - basically starts with a grid of 4 rectangles which can each be divided into a smaller version of a grid containing 4 smaller rectangles. PROBLEM: Sometimes though, one of the original 4…
Chexxor
  • 406
  • 6
  • 17
0
votes
0 answers

Complexity of range sum query in a quad tree

I want to solve a problem that gives the (integral) coordinates of n points (n<=10^5) and asks q queries (q<=10^4). In each query it gives the (integral) coordinates of two other points and we need to answer how many of the n points are located…
manolismi
  • 45
  • 1
  • 2
  • 7
0
votes
0 answers

Quadtree realization c++ (by Quad)

I'am using quadtree in 2D coordinates (base code get here: https://github.com/veeableful/Quadtree_Minimal) At start, code using just one point to detect rectangles inside quadtree. But detecting object is quad - select rectagles from quadtree become…
SomeCoder
  • 21
  • 4
0
votes
1 answer

Why I should use QuadTree with Collision Detection

I'm reading some about QuadTrees and how I can use them for a better collision detection. But I doesn't understand why QuadTrees brings me more performance. I'm trying this on a 2D Game. If I'm using a QuadTree I have to clear on every frame the…
R3Tech
  • 743
  • 2
  • 9
  • 22
0
votes
1 answer

Template iterators, dereferencing, and typedef in C++

I'm getting strange results from a program I'm working on and can't figure out where the error is or why I'm getting it. I'm working on a templated quadtree class that uses a templated iterator. Even though my function seems to work correctly, it…
Sunden
  • 843
  • 3
  • 11
  • 24
0
votes
1 answer

How To Texture A Quadtree

I am attempting to apply one solid texture to a quadtree but I am having a problem. How my quadtree works is by creating a new mesh each time there is a subdivision. So the tree starts as one mesh, then when it splits its 4 meshes, so on so…
CMilby
  • 624
  • 1
  • 6
  • 23
0
votes
1 answer

Spatial indexing 2D map using C++ templates for any shape

I have template class for spatial indexing which by default should work for any 2d object which implements function void boundingBox( Rect2d * box ) using std::vector as container of objects inserted in particular grid tile. template
Prokop Hapala
  • 2,424
  • 2
  • 30
  • 59