Results 1 to 4 of 4

Thread: Terrain Engine - trouble

  1. #1
    Member Contributor
    Join Date
    Dec 2001
    Location
    Porto Velho
    Posts
    97

    Terrain Engine - trouble

    Im a newbie in opengl (math too) and I cant use quadtrees this time, so Im coding my own *thing to make something like it. sorry about my english.... but.. it works like:

    all the terrain is height mapped, in 256x256 big quads... this quads together build the terrain, i want to draw just the quads that are in my view area, or more simple, to draw just quads that are RANGE units far from camera... thanks.

    code:

    Code :
    bool quad_in_range(int C_XPOS,int C_ZPOS,int QUAD_ID,int RANGE,int SIMPLE)
    {
    	int x=C_XPOS+(C_XPOS % 256); //C_XPOS = CAMERA POSITION ...
    	int z=C_ZPOS+(C_ZPOS % 256);
     
    			if((STerrain[QUAD_ID].xpos<=x+RANGE)&amp;&amp;(STerrain[QUAD_ID].zpos<=z+RANGE)) {
    				return TRUE;
    			}
    			else
    				return FALSE;
     
    }

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Terrain Engine - trouble

    And the question/trouble is?

  3. #3
    Member Contributor
    Join Date
    Dec 2001
    Location
    Porto Velho
    Posts
    97

    Re: Terrain Engine - trouble

    Ops...


    The question is

    why it isnt works? sorry

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Terrain Engine - trouble

    A few thing you haven't mentioned yet: what happens, what happens that should not happen, what is supposed to happen, what it is that doesn't work, .

    Considering how many things can go wrong in an application, I don't even want to take a wild guess untill you explain the problem with more details.

Similar Threads

  1. Fast Terrain Engine
    By bobGL in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 02-15-2007, 07:48 AM
  2. optimization terrain engine
    By IronRaph in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-09-2002, 08:40 AM
  3. Terrain Engine
    By mzh in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-13-2002, 02:31 AM
  4. Terrain engine
    By lsdi in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 01-27-2002, 11:51 PM
  5. Shadows in terrain engine
    By MrShoe in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-26-2001, 07:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean