Jump to content
  • Advertisement

fleurdelys77

Member
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

100 Neutral

About fleurdelys77

  • Rank
    Member
  1. fleurdelys77

    Terrain visualisation with a large map

    But the clipmaps is dynamic texture representation and it used GPU in rendring phase while I just use a CPU (opengl and Visual C++) Is there an other method please help me
  2. Hi every one, In order to visualize a large terrain, I use a height map with 16385 x 16385 pixel. To reduce the computation time I proceed as follow : 1. I read the map and save all the Y value in a array of 16385 x 16385 size 2. I use a recursive function to divide the terrain using quadtree concept and save only vertices which are visible using frustum culling test 3. I want to implement the CLOD (not yet achieved) My problem is the recursive function is a time consuming, so is there any method (may be cutting the map) to solve my problem I would be gratefull for any help Thanks in advance [color="#aab2b8"]
  3. fleurdelys77

    frustum culling with quadtree

    Thank you for your reply BuffaloJ, I tried drawing the bounding sphere but this last doesn't encompasses all the terrain patch. let me post my code off creating quadtree Could any one help me please [font="arial, sans-serif"][/font][font="arial, sans-serif"]void quadtree::UpdateQuadtree(BoundingSphere sphere, unsigned i, int step){[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] if(i < nbrSubdivision)[/font] [font="arial, sans-serif"] {[/font] [font="arial, sans-serif"] //Save the center vertex position of the level 0[/font] [font="arial, sans-serif"] int positionX = sphere.positionX;[/font] [font="arial, sans-serif"] int positionZ = sphere.positionZ;[/font] [font="arial, sans-serif"] float positionY;[/font] [font="arial, sans-serif"] //Calculate the radius sphere of the level 1[/font] [font="arial, sans-serif"] sphere.radius = (step*sqrt2)/2;[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] //Nord est child[/font] [font="arial, sans-serif"] sphere.positionX = positionX - step;[/font] [font="arial, sans-serif"] sphere.positionZ = positionZ - step;[/font] [font="arial, sans-serif"] sphere.positionY = map[sphere.positionX + width*sphere.positionZ];[/font] [font="arial, sans-serif"] if(quadtree::frustum(sphere)){[/font] [font="arial, sans-serif"] UpdateQuadtree(sphere, i+1, step/2);[/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] //Nord ouest[/font] [font="arial, sans-serif"] sphere.positionX = positionX + step;[/font] [font="arial, sans-serif"] sphere.positionZ = positionZ - step;[/font] [font="arial, sans-serif"] sphere.positionY = map[sphere.positionX + width*sphere.positionZ];[/font] [font="arial, sans-serif"] if(quadtree::frustum(sphere)){[/font] [font="arial, sans-serif"] UpdateQuadtree(sphere, i+1, step/2);[/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] //South est[/font] [font="arial, sans-serif"] sphere.positionX = positionX - step;[/font] [font="arial, sans-serif"] sphere.positionZ = positionZ + step;[/font] [font="arial, sans-serif"] sphere.positionY = map[sphere.positionX + width*sphere.positionZ];[/font] [font="arial, sans-serif"] if(quadtree::frustum(sphere)){ // The frustum return "true" if sphere is in or intersect the frustum and false if not[/font] [font="arial, sans-serif"] UpdateQuadtree(sphere, i+1, step/2);[/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"] //else IndexQuad[sphere.positionX + width*sphere.positionZ] = 0;[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] //Nord ouest[/font] [font="arial, sans-serif"] sphere.positionX = positionX + step;[/font] [font="arial, sans-serif"] sphere.positionZ = positionZ + step;[/font] [font="arial, sans-serif"] sphere.positionY = map[sphere.positionX + width*sphere.positionZ];[/font] [font="arial, sans-serif"] if(quadtree::frustum(sphere)){[/font] [font="arial, sans-serif"] UpdateQuadtree(sphere, i+1, step/2);[/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"] //else IndexQuad[sphere.positionX + width*sphere.positionZ] = 0;[/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"] else{[/font] [font="arial, sans-serif"] VERTEX V;[/font] [font="arial, sans-serif"] step = step*2;[/font] [font="arial, sans-serif"] //Fill the array DiplayVertex[/font] [font="arial, sans-serif"] V.x = sphere.positionX; V.z = sphere.positionZ; V.y = sphere.positionY;[/font] [font="arial, sans-serif"] DisplayVertex.push_back(V); //the center of the leaf[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] V.x = sphere.positionX - step ; V.z = sphere.positionZ - step; V.y = map[V.x + width*V.z];[/font] [font="arial, sans-serif"] DisplayVertex.push_back(V); //the north est vertex of the leaf[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] V.x = sphere.positionX + step ; V.z = sphere.positionZ - step; V.y = map[V.x + width*V.z];[/font] [font="arial, sans-serif"] DisplayVertex.push_back(V); //the north ouest vertex of the leaf[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] V.x = sphere.positionX + step ; V.z = sphere.positionZ + step; V.y = map[V.x + width*V.z];[/font] [font="arial, sans-serif"] DisplayVertex.push_back(V); //the south est vertex of the leaf[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] V.x = sphere.positionX - step ; V.z = sphere.positionZ + step; V.y = map[V.x + width*V.z];[/font] [font="arial, sans-serif"] DisplayVertex.push_back(V); //the south oust vertex of the leaf[/font] [font="arial, sans-serif"] [/font] [font="arial, sans-serif"] }[/font] [font="arial, sans-serif"]}[/font]
  4. Good morning every one, I try to implement the frustum culling with quadtree for terrain visualisation. I use bounding sphere but unfortunately a [font="arial, sans-serif"]large triangle missing. is this an error or is the frustum that small ? [/font] [font="arial, sans-serif"] [/font][color="#FFFFFF"][color="#000000"][font="arial, sans-serif"] [/font][font="Arial"] [/font] [font="arial, sans-serif"][/font]
  5. [font=Tahoma, Verdana, Arial, Helvetica] In general the plan equation is aX + bY +cZ +dw = 0, where a, b, c form the normal of the plane and d is the distance from the origin[color="#cccccc"] [/font]
  6. fleurdelys77

    terrain generation using quadtree

    thank you so much SuperVGA . I'll try to implement it 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
  7. fleurdelys77

    terrain generation using quadtree

    Cloud you give me more detail please ?
  8. fleurdelys77

    terrain generation using quadtree

    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
  9. 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!