Design Review

Design Review

Reply
Active Member
troup
Posts: 7
Registered: ‎09-19-2012
Message 1 of 3 (372 Views)

Programatically move the camera to selected object?

372 Views, 2 Replies
09-20-2012 06:39 AM

I am able to programatically select 3D objects via the javascript API (see my previous post). I would now like to programatically move the camera such that the selected object is centred in the camera.

 

I have been able to do this with 2D objects by getting the objects Extents then setting the Section view. But this approach is not applicable with 3D.

 

Any help appreciated.

 

Cheers

Active Member
troup
Posts: 7
Registered: ‎09-19-2012
Message 2 of 3 (368 Views)

Re: Programatically move the camera to selected object?

09-20-2012 07:23 AM in reply to: troup

The reply to the following post seems to suggest that programatically moving the camera to the selected object is possible:

 

http://forums.autodesk.com/t5/Autodesk-Design-Review/Zoom-the-object-in-3D/td-p/2548696

 

The extents property has Front and Back properties in addition to Left, Right, Top, Bottom.

 

But the Camera position has X,Y,Z co-ordinates...

 

So how do you use the extents to set the camera position?

Active Member
troup
Posts: 7
Registered: ‎09-19-2012
Message 3 of 3 (362 Views)

Re: Programatically move the camera to selected object?

09-20-2012 07:31 AM in reply to: troup

Another tantalizing post:

 

http://forums.autodesk.com/t5/Autodesk-Design-Review/API-ADR-2011-2012-only-as-Renderer-and-source-o...

 

For 3D bojects:

    2. Define your specify EModelCamera object base on the boundaries (IAdCube).

    3. Set you specify 3D view to render objects via EModelSection.Camera property.

 


How do you "specifyEModelCamera object base on the boundaries" in Javascript? 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.