![]() |
#1 |
Junior Member
Member
Join Date: Oct 2009
Posts: 10
|
![]()
How do I get the position of the 3D camera from the PlugIn interface? I want to programmatically generate screenshots at different positions and orientations.
I've tried ac_object_get_centre(ac_views_get_default_camera() ), and it gives the position of something, but it doesn't seem to change as I move the 3D view around. Once I get the position, how can I move the camera? ac_camera_move_forward() doesn't seem to do anything either. |
![]() |
![]() |
![]() |
#2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,539
|
![]()
Almost, but the camera is not an ACObject.but an ACEntity.
Once you have the ACCamera from ac_views_get_default_camera(), you should be able to use the ac_entity_set/get* functions to set/get the values. (origin (Point3), location (Point3), rotation (Point3), spin (Point3), scale (float), move_dist (float), move_angle (float), walk_vehicle (Boolean), offset (Point3), fov (float)) The ac_camera_move_* functions should work fine although you may need to redraw the view after(?) You must ensure that it's in walk mode for many of the functions to work, since they don't make sense in spin mode. You may also find that a lot of this can be done from a script too. You can also call tcl_command(char *) with a script command inside your plugin. |
![]() |
![]() |
![]() |
#3 |
Junior Member
Member
Join Date: Oct 2009
Posts: 10
|
![]()
Thanks Andy, that did it!
|
![]() |
![]() |
![]() |
#4 |
Junior Member
Member
Join Date: Oct 2009
Posts: 10
|
![]()
It seems that 'direction' is also one of the values that can be set.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
Member
Join Date: Oct 2009
Posts: 10
|
![]()
Is there a way in Walk mode to change the camera's roll angle? I've tried the rotation and spin properties and they don't seem to have any effect.
|
![]() |
![]() |
![]() |
#6 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,539
|
![]()
Sorry, no, 'up' is fixed.
|
![]() |
![]() |
![]() |
#7 |
Junior Member
Member
Join Date: Sep 2005
Posts: 10
|
![]()
This has nothing to do with get/setting camera (but that was useful information). I just using this thread to get this question out. How is the URL used in the object property entry? I mean I enter URL, but so what. I can't see how it is acted on by anything in AC3D or by the object.
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|