Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Modeling    Translation of an object only on XZ Plane

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Member
Posted
Hi @all !

I want to drag and translate an object only on XZ plane.
I've searched allready in viewpoint code reference but i found nothing.
Please can anybody help me to realize this?

greetings,
ramius
 
Posts: 1 | Registered: February 09, 2007Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of duncan
Posted Hide Post
There may be an easier way to do this, but this is what I suggest off the top of my head:

1) create an interactor that handles the drag of your object:

<MTSInteractor Name="move_myObj">
<Target Name="myObj"/>
<MTSHandle Event="MouseDrag" Action="MTSDrag" Target="myObj"/>
<MTSHandle Event="MouseDrag" Action="dragObj"/>
</MTSInteractor>

2) use vetscript to restrict the movement along the Y plane:

<MTSAction Name="dragObj" Type="VETScript">
<!--
coords = MTSInstance[myObj].loc_;
coords.y = 0;
MTSInstance[myObj].loc_ = coords;
-->
</MTSAction>
 
Posts: 381 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Modeling    Translation of an object only on XZ Plane