xelons
11-07-2012 00:32:31
Hey guys,
I just started using pagedgeometry and its absolutely great.
I have successfully compiled it and run the examples with no problem.
My question is I have tried to take a look at the grassloader source code to get an idea on how its coordinate system works but Im still having problems.
My first question is how does setHeightFunction really works? I mean I know we need to pass a heightfunction to it in order for it to determine the y coordinate but that height function accepts x and z coordinates.
From where does grassloader get that x and y coordinates? I know that there is a setMapBounds function that specify the map boundaries but in the example 4 that function is called at the end, AFTER the setHeightFunction was called.
In my project I use a custom terrain paging based on voxels, to determine the height of a current page i use a special function that returns the height at a specific x and z location. I pass that function to the setHeightFunction and then I set in the setMapBounds my current page xstart zstart and xend zend. So basically I set a new grass layer for every terrain page after it being loaded.
Is this the right way to do it? seeing that my terrain is randomly generate using a noise function and its technically infinity.
In my case is there any other boundaries that I need to modify to bound the grass for every specific paged page?
I just started using pagedgeometry and its absolutely great.
I have successfully compiled it and run the examples with no problem.
My question is I have tried to take a look at the grassloader source code to get an idea on how its coordinate system works but Im still having problems.
My first question is how does setHeightFunction really works? I mean I know we need to pass a heightfunction to it in order for it to determine the y coordinate but that height function accepts x and z coordinates.
From where does grassloader get that x and y coordinates? I know that there is a setMapBounds function that specify the map boundaries but in the example 4 that function is called at the end, AFTER the setHeightFunction was called.
In my project I use a custom terrain paging based on voxels, to determine the height of a current page i use a special function that returns the height at a specific x and z location. I pass that function to the setHeightFunction and then I set in the setMapBounds my current page xstart zstart and xend zend. So basically I set a new grass layer for every terrain page after it being loaded.
Is this the right way to do it? seeing that my terrain is randomly generate using a noise function and its technically infinity.
In my case is there any other boundaries that I need to modify to bound the grass for every specific paged page?