We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am developing a genomic visualization package using Processing and Proscene - I am blown away by the power of both of these pieces of software!!! Kudos to the developers for making it possible for us to implement such sophisticated functionality with so little effort!!!!
I am trying to make it possible to zoom,pan, or rotate a 3-D model of a chromosome using the standard mouse techniques AS WELL AS allow the user to enter (either with sliders or textfields) values that will serve the same function. To do this, I have to report the current state of the camera as he moves/drags the mouse AND react to values that he enters thru the gui. Here is what I have done so far:
To allow panning I allow the user to set the world coordinate he would like to see at the center of the window. I take the value he enters and do: camera.setSceneCenter(value); camera.centerScene(); which works fine. But I cannot figure out how to calculate and report the world coordinate at the center of the window when the user uses the mouse to move the camera. This is of course essential to report to the user by updating the gui fields as he moves around with the mouse.
For zooming, the reverse applies - when the user zooms with the mouse, I can report the value to the user by calling camera.distanceToSceneCenter(). But when the user types in a distance value in the gui, I don't know how to move the camera to the specified distance from the scene center. Is there a function or sequence of steps for that?
For rotation, I report the 3 Euler angles (pitch, yaw, and roll) based on the current orientation of the camera - by calling camera.orientation().eulerAngles. But I don't know how to do the reverse - i.e., given angles that the user has entered thru the gui, how do I rotate the camera to achieve what he wants?
Would appreciate any help on these topics. Thanks!