Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Content FAQ's    changing mtshandle events & widget layer data - Text or Texture

Read-Only Read-Only Topic
Go
New
Find
Notify
Tools
-star Rating Rate It!  Login/Join 
<Viewpoint>
Posted
I have a 3d scene with a ZoomView widget. Is there a way I can make the event handles for the ZoomView zoom/pan using keyboard commands and not change the 3d part of the scene?
 
Report This Post
<Viewpoint>
Posted
Yes, you can do that. Firstly enable keyboard commands in the ZoomView. You can do that in the ZoomView Builder, or you can add the following tag to the ZoomView animation:

Evnt="1"

Shift zooms in, crtl zooms out and the arrow keys pan.

The following code shows how to apply zoom to a widget. Since keyboard commands are enabled, the key commands will cause your image to zoom in and out.

NOTE: I have changed <> to [] so that all the code shows correctly here.

[?xml version="1.0"?]
[!-- Viewpoint Experience Technology scene description file. --]
[!-- Created: Sun Mar 10 09:49:49 2002 --]
[!-- Creator: Viewpoint Scene Builder (Build 3.0.10.39) --]
[!-- Author: Andrew --]
[MTSScene Version="308" ]
[MTSTextureMap Name="zoom_on_widget_TEXTURE_0" /]
[MTSTimeElem Name="mySmoothZoom" Type="MTSZoomView" On="1" PreAnimator="1" Zfit="2"
Evnt="1"
ImageSize="1536 2048"
TileSize="128"
BaseName="ice_hotel_chanderlea_images/ice_hotel_chanderlea.mzv"
]
[Target Name="MTSTexture.zoom_on_widget_TEXTURE_0" /]
[/MTSTimeElem]
[MTSAction Name="ZoomPan"]
[MTSSetProperty Target="mySmoothZoom:Big GrinelU" Value="dx" /] [MTSSetProperty Target="mySmoothZoom:Big GrinelV" Value="dy" /] [MTSSetProperty Target="mySmoothZoom:Big Grinel0" Value="1" /]
[/MTSAction]
[MTSAction Name="ZoomAnimIn"]
[MTSSetProperty Target="mySmoothZoom::ScrX" Value="x" /]
[MTSSetProperty Target="mySmoothZoom::ScrY" Value="y" /]
[MTSSetProperty Target="mySmoothZoom::IncZ" Value="z" /] [MTSSetProperty Target="mySmoothZoom::TimT" Value="1" /]
[/MTSAction]
[MTSAction Name="ZoomAnimOut"]
[MTSSetProperty Target="mySmoothZoom::IncZ" Value="z" /] [MTSSetProperty Target="mySmoothZoom::TimT" Value="1" /]
[/MTSAction]
[MTSSceneParms RenderMode="LightTexture" ShowWidgets="1" BlendShadow="1" EdgeBias="1" /]
[MTSCamera OrbitDist="4" ]
[ViewLocation x="0" y="0" z="4" /]
[/MTSCamera]
[MTSInstance Name="Simple_0" Visible="0" ]
[Transform]
[Scale x="0.5" y="0.5" z="0.5" /]
[/Transform]
[MTSGeometry Name="MTSSimple_0" Type="MTSCube" /]
[MTSInstance Name="Layer2D_0" Collapsed="1" ]
[Transform]
[Scale x="0.2" y="0.2" z="0.2" /]
[/Transform]
[LayerData Texture="MTSTexture.zoom_on_widget_TEXTURE_0" /]
[MTSHandle Event="MouseLeftDown" Action="ZoomAnimIn" z="2" x="MTSEvent::ucrd" y="MTSEvent::vcrd"/] [MTSHandle Event="MouseRightDown" Action="ZoomAnimOut" z="-2" /] [MTSHandle Event="MouseDrag" Action="ZoomPan" dx="MTSEvent::_dx_" dy="MTSEvent::_dy_"/] [/MTSInstance]
[/MTSInstance]
[MTSTimeElem Type="MTSStream" Name="zoom_on_widget" Path="zoom_on_widget.mts" ]
[Target Name="MTSInstance.Simple_0" /]
[/MTSTimeElem]
[/MTSScene]
 
Report This Post
  Powered by Eve Community  

Read-Only Read-Only Topic

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Content FAQ's    changing mtshandle events & widget layer data - Text or Texture