[DONE] Camera placement

All ideas and stuffs that should be developed
Post Reply
VPO
Posts: 2
Joined: Thu Dec 16, 2010 10:55 am

[DONE] Camera placement

Post by VPO »

Hello,

First of all thank you for sharing and the development of this software. It has already helped me a lot !

I notice a limitation in terms of camera's placement. Indeed, I would like to define " in hard" spatial position of the center of rotation by clicking a 3D point. This option is available ?

Hoping to have been sufficiently explicit.

Thank you in advance for your answers.

Sincerely,

Valentin
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Camera placement

Post by daniel »

Interesting!

Two users asking the same thing the same day: we should definitively add this functionality!

The sole solution for changing camera 'placement' right now is to select one or more entity and to click on the "magnifier" icon (left toolbar). It will automatically center the camera on the center of gravity of the selection.

To do it "quick and dirty": we can simply activate at least the "camera translation" fields (Tx,Ty,Tz) in the camera parameters dialog (left toolbar) soon. As you can "pick" a point with the "point picking" tool (its coordinates are then displayed both on screen and in the console area), you could then recopy these coordinates in the translation fields. It should do the trick, at least temporarily.

I'll keep you informed.

Daniel
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Camera placement

Post by daniel »

Ok, the 'camera parameters' dialog has been updated: now the user can set the 'pivot' point by specifying its 3 coordinates.

As you can also pick a point (with the 'camera parameters' dialog still active), you can copy its coordinates in those fields and you'll get the camera centered on a given point!

The next step will be to do this automatically... Meanwhile, I hope it will do the trick.

Daniel
Daniel, CloudCompare admin
VPO
Posts: 2
Joined: Thu Dec 16, 2010 10:55 am

Re: Camera placement

Post by VPO »

Hello,

I just take the latest version of Cloud Compare and I made some manipulations on the camera position. The result is nice.

Thank you.

Sincerely,

Valentin
jfhullo
Posts: 90
Joined: Thu Oct 14, 2010 7:16 am

Re: Camera placement

Post by jfhullo »

Thanks daniel for the improvment.
dktrudgett
Posts: 6
Joined: Mon Dec 13, 2010 4:20 am

Re: Camera placement

Post by dktrudgett »

I'm looking at coding an automated way for the user to set the rotation pivot point (i.e. to avoid the manual copy and pasting of values). Are there any suggestions about the preferred way this should be done? Or has any work been done on this since 2011-02-11?

Thanks,
David.
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Camera placement

Post by daniel »

Very good!

You should first look how the "point picking tool" works (ccPointPropertiesDlg or ccPointListPickingDlg).

I think a simple way to do it could be:
  • Add a "ToolButton" to the camera dialog next to the camera center coordinates fields (with the "point picking" icon typically ;)
  • When the user click on it, activate the point picking mechanism on the current window and connect the window 'point picked' signal to a new slot on this dialog
  • When a point is picked, fill the coordinates fields with it (the standard process should then run as if the user had entered them himself)
  • Deactivate the point picking mechanism
Here are some directions/hints:
  • You can activate the point picking mechanism on a 3D window with the 'setPickingMode' method:

    Code: Select all

    win->setPickingMode(POINT_PICKING);
  • To deactivate it:

    Code: Select all

    win->setPickingMode(DEFAULT_PICKING);
  • The current 3D window is named 'associatedWin' in the ccCameraParamEditDlg class
  • When the picking mechanism is activated, each time a point is selected, the window emit the 'pointPicked' signal

    Code: Select all

        //! Signal emitted in point picking mode to declare picking of a given point
        /** \param cloudID cloud unique ID
            \param pointIndex point index in cloud
        **/
        void pointPicked(int cloudUniqueID, unsigned pointIndex);
    
  • To get the point coordinates, you just have to request the right point cloud to the DB (I've just added the 'dbRoot()' method to the MainWindow class to make this easier)

    Code: Select all

        ccHObject* obj = MainWindow::TheInstance()->dbRoot()->find(cloudID);
        if (obj && obj->isKindOf(CC_POINT_CLOUD))
        {
            ccPointCloud* cloud = static_cast<ccPointCloud*>(obj);
            const CCVector3* P = cloud->getPoint(pointIndex);
        }
    
  • Eventually, there's a mechanism to detect if the current window focus has changed, but for a first shot, you can forget it!
Don't hesitate to ask me for any precision and good luck!
Daniel, CloudCompare admin
dktrudgett
Posts: 6
Joined: Mon Dec 13, 2010 4:20 am

Re: Camera placement

Post by dktrudgett »

Many thanks, Daniel! That should get me started. I'll certainly ask if I have any further questions.

David.
Dimitri
Posts: 156
Joined: Mon Oct 18, 2010 9:01 am
Location: Rennes (France)
Contact:

Re: Camera placement

Post by Dimitri »

Hi all,

automatically positioning the center of rotation at picked point would be really great. This way you can navigate clouds with very large spatial extension. This works really well for instance in Leica Cyclone : you click on a specific icon (or you use a keyboard shortcut), the cursor changes to a target, you pick a point, and then you're centered and back to the noraml operation of the mouse (rotation, translation etc...).

Dim
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Camera placement

Post by daniel »

I was waiting for updates about this functionnality from dktrudgett (who was willing to advance on this topic).

I might do it myself soon however.

Daniel
Post Reply