
I am working to create interactive deformable objects that can be created by button clicks on a haptic device. I am using a combination of X3D and Python with H3DAPI. The end result of this exercise is to gain knowledge in order to apply this to DICOM or other CAD 3D models for Medical simulation.
To start I tried using the mouse as an input. I am having trouble getting the mouse position data formatted correctly in Python. I currently have one axis partially working. The problem stems from a datatype used in Python specific to H3d. The value returned by routing the Mouse position data from the X3D file to Python is a SFVec2. This is not compatible with the Vec3f datatype needed by the translation command for determining the position of a point. I started out using a mouse assuming it would be easier. This assumption was incorrect.
Another concern with the mouse is in regards to the viewport. The value the mouse returns is based on the position of the pointer within the H3D window. You must use an orthogonal screen and lock camera rotation. If you use perspective the position of the sphere created will be offset from the position of the mouse for a large range of points.
My next course of action is to remove the mouse and get actual 3D positions from either the Falcon or Omni haptic device. It is possible there are still problems with the datatype (part of which I can now solve) but regardless I don't have the problem with possition offset.
No comments:
Post a Comment