• ### Popular Now

• 13
• 18
• 19
• 27
• 10

This topic is 2442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Good morning every body,

I tray to generate terrain with a huge height map and for data storage I want to use Quadtree structure.
My question is how can I generate my terrain without storing all the data in the Quadtree in the main memory ?

##### Share on other sites
This is a very short question. What are you doing right now that isn't working? What specifically is not working as you wanted.
Quad trees are used to organize data, not to generate it --or store it directly, it would hold a pointer to where the actual storage is. Are you getting your terms mixed up?

If you want help, post more than two sentences asking for someone to do work for you. Show us what you have done so far, or what you thoughts are before you ask for help on something.

##### Share on other sites
I tray to understand the main process of uploading in real time to the data storing in height map in the disc using Quadtree in order to generate terrain.

Well, so far I know that :
A quadtree is a 2D data structure,
Hierarchical quadtree is based on the principle of recursive decomposition (each node contain 4 more nodes)
[color="#1c2837"] A leaf is the last node in the quadtree and it contain data (or as known bonding box Xmin,Xmax, Zmin, Zmax) (in the case of terrain)
[color="#1c2837"]

[color="#1c2837"]But how can I code this and uploading data in real time, knowing that this last (data) is stored in disc and not in the main memory ?
[color="#1c2837"]

[color="#1c2837"]Hope that this will be more clear. [color=#1C2837][size=2]Any help will be appreciated

##### Share on other sites
I tray to generate terrain with a huge height map and for data storage I want to use Quadtree structure.
My question is how can I generate my terrain without storing all the data in the Quadtree in the main memory ?

Hi!

What do you mean by main memory? The heap?
You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

##### Share on other sites
Hidden

Hi!

What do you mean by main memory? The heap?

I mean the RAM

You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

Cloud you give me more detail please ?

Hi!

What do you mean by main memory? The heap?

I mean the RAM

You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

Cloud you give me more detail please ?

##### Share on other sites
Hidden

Hi!

What do you mean by main memory? The heap?

I mean the RAM

You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

Cloud you give me more detail please ?

Hidden

Hi!

What do you mean by main memory? The heap?

I mean the RAM

You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

Cloud you give me more detail please ?

4x

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
Hi!

What do you mean by main memory? The heap?

I mean the RAM

You can generate elsewhere, while it's likely that at genesis, the quadtree will not be utilized yet (the terrain doesn't exist fully at that point)
Then "give" references to the generated terrain patches to the quadtree afterwards.

Cloud you give me more detail please ?
[/quote]
Sure! There, there! -I get it!
You mean the heap.
Here's what i meant by that brief suggestion i wrote:
For instance, you have one class responsible for generating your geometry from a heightmap, and another which is the controller(accessible class) for the quadtree.
Also, you probably have a class that directly or indirectly is able to communicate to both, and asks the generator to generate patches, and then tells the quadtree that {0;15},{48;63} should refer to (among other things): patch #12 (which you retrieve from the generator either by 2D coord or from within a list of patches).

Level 2 (each leaf covers 16^2 units):
 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [X] [ ] [ ] [ ] 
Level 1: (each internal node covers 32^2 units):
 [ ] [ ] [X] [ ] 
Level 0: (the root node covers 64^2 units):
 [X] 

-The quadtree controller should accept references to geometry and store it within its hierarchy.

A quadtree is a 2D data structure,
Hierarchical quadtree is based on the principle of recursive decomposition (each node contain 4 more nodes)

By the way, as far as I can tell, a quadtree is always hierarchical, that's why it's a tree. Otherwise it would just be a single-level grid (or subdivided plane)

A patch would be a bit of terrain, likely a size which is practical to send to the GPU without too much space or being so little that a call to draw it takes too long relative to
how much geometry it contains. Play around with that part a bit.

(and in case those silly responses with 1min intervals was not an accident: please don't do that. )