Skip to content

enhancement: option to set default mousewheel for translational movement rather than zoom #464

@SugarRayLua

Description

@SugarRayLua

For geographic 3D models, it may useful in an upcoming rgl release to include an option for the mouse wheel to translate through the model rather than magnify it as in this example:

library(rgl);
# cube = test mesh
cube <- cube3d(color = rainbow(6), meshColor = "faces");
shade3d(cube);
# movement = global space units to move per mouse wheel movement
movement <- 0.5;
# will move scene around mesh (note uses openGL axis for camera: + x right, +y up, z in/out of screen)
camForwardBackward = function(wheelDirection){
  if(wheelDirection == 1){
    observer3d(par3d("observer")[1], par3d("observer")[2], par3d("observer")[3] + movement);
  } else if(wheelDirection == 2){
    observer3d(par3d("observer")[1], par3d("observer")[2], par3d("observer")[3] - movement);
  }
};
rgl.setWheelCallback(rotate = camForwardBackward)

fyi
Thank you for considering the above enhancement :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions