Sign in to follow this  
fleurdelys77

terrain generation using quadtree

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 ?

Thanks in advance

Share this post


Link to post
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 this post


Link to post
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)
[size="2"][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][/size]
[size="2"][color="#1c2837"]
[/color][/size]
[color="#1c2837"][size="2"]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 ?[/size][/color]
[color="#1c2837"][size="2"]
[/size][/color]
[color="#1c2837"][size="2"]Hope that this will be more clear. [/size][/color][color=#1C2837][size=2]Any help will be appreciated [/size][/color]

Share this post


Link to post
Share on other sites
[quote name='feriel' timestamp='1310464515' post='4834209']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 ?
[/quote]
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 this post


Link to post
Share on other sites
Hidden
[quote name='SuperVGA' timestamp='1310468677' post='4834233']
Hi!

What do you mean by main memory? The heap?

I mean the RAM
[/quote]

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
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.
[/quote]

Cloud you give me more detail please ?


Share this post


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

What do you mean by main memory? The heap?

I mean the RAM
[/quote]

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
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.
[/quote]

Cloud you give me more detail please ?


Share this post


Link to post
Share on other sites
Hidden
[quote name='SuperVGA' timestamp='1310468677' post='4834233']
Hi!

What do you mean by main memory? The heap?

I mean the RAM
[/quote]

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
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.
[/quote]

Cloud you give me more detail please ?


Share this post


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

What do you mean by main memory? The heap?

I mean the RAM
[/quote]

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
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.
[/quote]

Cloud you give me more detail please ?


Share this post


Link to post
[b]4x[/b][quote name='feriel' timestamp='1310469808' post='4834241']
[quote name='SuperVGA' timestamp='1310468677' post='4834233']
Hi!

What do you mean by main memory? The heap?

I mean the RAM
[/quote]

[quote name='SuperVGA' timestamp='1310468677' post='4834233']
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.
[/quote]

Cloud you give me more detail please ?
[/quote]
Sure! There, there! -I get it! [img]http://public.gamedev.net/public/style_emoticons/default/laugh.gif[/img]
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):
[code]
[ ] [ ] [ ] [ ]

[ ] [ ] [ ] [ ]

[ ] [ ] [ ] [ ]

[X] [ ] [ ] [ ]
[/code]
Level 1: (each internal node covers 32^2 units):
[code]
[ ] [ ]

[X] [ ]
[/code]
Level 0: (the root node covers 64^2 units):
[code]
[X]
[/code]

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

[quote name='feriel' timestamp='1310469808' post='4834241']
A quadtree is a 2D data structure,
Hierarchical quadtree is based on the principle of recursive decomposition (each node contain 4 more nodes)
[/quote]
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. [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img])

Share this post


Link to post
Share on other sites
thank you so much SuperVGA . I'll try to implement it [img]http://public.gamedev.net/public/style_emoticons/default/biggrin.gif[/img]

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this