Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:sdksamples:trackcamera [2015/09/14] (current)
Line 1: Line 1:
 +====== Tracking Camera changes with a Conduit ======
 +> **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​
 +> **Summary:​** //​Demonstrates how to use a develop a conduit that uses notifiers to track camera information.//​
  
 +===== Question =====
 +How can I get windows message from Rhino viewport, specifically when rotating some object in viewport with right click? My goal is to get the parameters from the camera viewport when there is an event, like mouse move or right click. I need those camera settings parameters, so i can set them in another view.
 +
 +===== Answer =====
 +This can be done through what is called a Conduit Notification. You, basically, setup a **CRhinoDisplayConduit**,​ attach it to a specific viewport (or all), and then "​listen"​ for specific notifications by overriding **CRhinoDisplayConduit::​NotifyConduit**. In your case, you'd most likely be interested in **CN_PIPELINEOPENED**,​ **CN_PIPELINECLOSED**,​ and **CN_PROJECTIONCHANGED** events. On those events you can query the current viewport (camera) for any settings you want, and then set your stuff accordingly.
 +
 +The following example plug-in command demonstrates a conduit that uses notifiers to track camera information. It also demonstrates how to create a HUD (Heads Up Display) used to display the tracked results and overlay them onto the viewport using transparent bitmap drawing.
 +
 +==== C++ ====
 +{{:​developer:​sdksamples:​cmdtestcameratracker.zip|Test Camera Tracker}}
 +
 +\\
 +
 +{{tag>​Developer cplusplus}}
developer/sdksamples/trackcamera.txt ยท Last modified: 2015/09/14 (external edit)