Viewpoint Forums
Viewpoint Forums
Viewpoint Tips, Tricks & Hacks
multiple camera's|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Member![]() |
In my scene I want to create multiple camera locations. Is there a easy way, like this:
<MTSInteractor Name="resetcamera" >
<Target Name="MTSInstance.Simple_0" />
<MTSHandle Event="MouseLeftClick" Target="MTSTimeElem.MTSCameraHome::trgr" Value="1" Action="MTSAssignProperty" />
</MTSInteractor>
to get the camera to these locations??? So the camera doesn't go to MTSCameraHome but to a predefined locion?? |
||
|
|
Member |
I think the easiest way to do this is something like:
<MTSInteractor Name="rotate_camera"> <Target Name="MTSInstance.Simple_0"/> <MTSHandle Event="MouseLeftClick" Action="MTSSetProperty" Target="MTSCamera" Property="rot_" Value="0 90 180"/> </MTSInteractor> of course you can change the orbit (orbd) and location (loc_) properties too. |
|||
|
Member![]() |
I tried it this way but the camera goes instantly to this location. Is there anyway to animate the translation?(like MTSCameraHome)
maybe: x=x+1 or something?? |
|||
|
|
Member |
You want to create a keyframe aniamtion like so:
<MTSScene Version="311"> <MTSSceneParms RenderMode="LightTexture" BlendShadow="1" EdgeBias="1"/> <MTSCamera OrbitDist="4"> <ViewLocation x="0" y="0" z="4"/> </MTSCamera> <MTSInstance Name="Simple_0"> <Transform> <Scale x="0.5" y="0.5" z="0.5"/> </Transform> <MTSGeometry Name="MTSSimple_0" MultiUV="0" Type="MTSCube"/> <OnClick Action="Trigger" Target="rotate_camera"/> </MTSInstance> <MTSTimeElem Type="Keyframe" Name="rotate_camera" On="0"> <Target Name="MTSCamera" Property="rot_" Timeline="T1"/> <Time>0 3</Time> <Timeline Name="T1" Type="3D"> * [0 90 180] </Timeline> </MTSTimeElem> </MTSScene> ...the key part of the above code is the "MTSTimeElem" keyframe animation. That is what you will use to animate the cameras rotation, location, etc. You can find lots of information about animations in our documentation: http://developer.viewpoint.com/developerzone/5-222.html particularly these: http://developer.viewpoint.com/developerzone/docs/using_3d.pdf http://developer.viewpoint.com/developerzone/docs/tech_overview.pdf |
|||
|
|
Member |
I actually have the reverse problem here. I want my camera to go right back to the default position, with NO animation in between. I used:
<MTSInteractor Name="resetcamera" > <MTSHandle Event="cameraReset_msg" Target="MTSTimeElem.MTSCameraHome::trgr" Value="1" Action="MTSAssignProperty" /> </MTSInteractor> but it rotates a bunch first before going to where it should be. Anyway to make it direct? |
|||
|
|
Viewpoint Sr. Expert Member |
The cleanest way is to create an action the sets all the pertinent camera properties back to your default and then initiate that action when you need it. There are other ways like using LoadMTX to reload the camera settings but that’s only going to work if your Camera instance is verbose enough to cover all the setting that might change and your hierarchy is set correctly.
I’ve seen that strange camera rotation when using MTSCameraHome and it’s a known bug but not high on the list to get fixed because it’s dependent on how the scene was created whether it will occur. ~B |
|||
|
|
Member |
Yeah I was worried I wouldnt be able to control it, so I just went with doing it in MTSTimeElem instead. |
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

