Conversation
Lets you account for the fact that the viewer isn't standing at ground level (e.g. an apartment floor), by reusing horizonator_move() to reposition the camera at ground_elevation + viewer_height after the usual auto-selected ground elevation is computed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Hi. Thanks for the patch. If we're going to do this, I'd like to do a little bit better. Instead of an extra call to bool horizonator_init( // output
horizonator_context_t* ctx,
// input
float viewer_lat, float viewer_lon,
// output/input
// if viewer_z==NULL, auto-select a value; if *viewer_z >=
// 0, use that; if *viewer_z < 0, auto-select a value, and
// report it here
float* viewer_z,
int offscreen_width, int offscreen_height,
int render_radius_cells, // This should be given >0
float render_radius_m, // or this, but not both
bool use_glut,
bool render_texture,
bool SRTM1,
const char* dir_dems,
const char* dir_tiles,
const char* tiles_name,
const char* tiles_url_fmt,
bool allow_downloads);
bool horizonator_move(horizonator_context_t* ctx,
// output/input
// if viewer_z==NULL, auto-select a value; if *viewer_z >=
// 0, use that; if *viewer_z < 0, auto-select a value, and
// report it here
float* viewer_z,
// input
float viewer_lat, float viewer_lon);Among other things, this API breaks below sea level. Can you update the code to use this API instead? bool horizonator_init( // output
horizonator_context_t* ctx,
// if non-NULL, report the elevation of the DEM here
float* viewer_z_dem,
// input
float viewer_lat, float viewer_lon,
float viewer_z, // either above sea level, or above the
// DEM, depending on the next argument
bool viewer_z_is_given_above_dem,
int offscreen_width, int offscreen_height,
int render_radius_cells, // This should be given >0
float render_radius_m, // or this, but not both
bool use_glut,
bool render_texture,
bool SRTM1,
const char* dir_dems,
const char* dir_tiles,
const char* tiles_name,
const char* tiles_url_fmt,
bool allow_downloads);
bool horizonator_move(// output
horizonator_context_t* ctx,
// if non-NULL, report the elevation of the DEM here
float* viewer_z_dem,
// input
float viewer_lat, float viewer_lon,
float viewer_z, // either above sea level, or above the
// DEM, depending on the next argument
bool viewer_z_is_given_above_dem);Seems reasonable? Then the default usages would pass And if you make frontend changes, can you please modify the |
|
Can you also update the python API to use this interface update? |
Lets you account for the fact that the viewer isn't standing at ground level (e.g. an apartment floor), by reusing horizonator_move() to reposition the camera at ground_elevation + viewer_height after the usual auto-selected ground elevation is computed.