terrain generation using quadtree

Started by
5 comments, last by fleurdelys77 12 years, 9 months ago
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 ?

Thanks in advance
Advertisement
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.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.
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
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.

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 ?



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 ?


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! laugh.gif
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. smile.gif)
thank you so much SuperVGA . I'll try to implement it biggrin.gif

I'm sorry for the mistakes, I had a very bad connection and I was thinking that it didn't sand. I'm so sorry

This topic is closed to new replies.

Advertisement