HeightfieldTesselator question

void HeightfieldTesselator::set_focal_point(int x, int y);

Description: Sets the focal point. The tesselator generates high-resolution terrain around the focal point, and progressively lower and lower resolution terrain as you get farther away. The units are in pixels. 


Seeing as HeightfieldTesselator has the methods setHorizontalScale() and setVerticalScale() I assume that I will need to track the transformation from Panda3D coordinates to pixel coordinates on my own. Do you have any neat tricks you play to ease the transformation of your camera coordinates into pixel coordinates for setFocalPoint() ?

Uhm… no. :slight_smile: But I suppose it’s just this:

ix = int(round(x/horizontalScale))
iy = int(round(-y/horizontalScale))