我的订单|我的收藏|我的商城|帮助中心|返回首页
虚拟现实新闻>VR>VR软件>Virtools

Virtools 进阶教程—Has Attribute属性 - Virtools

文章来源:网络收集 作者:Frank 发布时间:2010年04月28日 点击数: 字号:

Has Attribute

1.jpg

Instruction:

  此范例可以和「Groups」作比较。

 

  物体由Mouse Cursor碰触后会产生旋转的效果,旋转的速度则利用Attribute-My Own Float来控制,当Mouse Cursor离开物体时,物体便停止旋转。

 

Building Blocks:

 

(a) Set As Active Camera-Cameras/Montage/Set As Active Camera
(b) Text Display-Interface/Text/Text Display
(c) 2D Picking-Interface/Screen/2D Picking
(d) Has Attribute-Logics/Attribute/Has Attribute
(e) Per Second-Logics/Calculator/Per Second
(f) Rotate-Transformations/Basic/Rotate

 

制作构想:

 

  主要是利用Building Blocks-Has Attribute赋予每个物体其属性不同的参数值来影响物体旋转的速度,再配合Building Blocks-Per Second、Rotate便可以达到旋转的效果。

 

制作步骤:

 

(a) Camera

2.jpg

Set As Active Camera:设定现在所使用的Camera。设定Target-NA即正前方。 Text Display:文字说明。

 

(b) Ground

3.jpg

Get Mouse Position:由Mouse Cursor即可得到2D 位置,由pOut输出(如图标)。

4.jpg

2D Picking:利用pIn输入Mouse Cursor 2D的坐标位置而得到一物体,并于pOut输出该物体Object Picked;且不勾选Edit Parameters-Window Relative。

 

  如果输出为True即执行Building Blocks-Has Attribute;输出为False即重新执行2D Picking。

 

  Has Attribute:首先于Level Manager/Default Level/Global/3D Objects/Rock/Add Attribute/My own attribute增加属性-My own float,再设定属性My own float值为4。

 

  其它物体Ball、Box、Statue依同样方式将属性My own float值分别设定为2、3、1(如图标)。

 

  设定Target-即Building Blocks所输出物体Object Picked;设定Category--My own attribute-、Attribute-My own float(如图标),此属性My own float值将影响其旋转的速度。

 

  最后由pOut输出变量值Attribute Value。

5.jpg
6.jpg
7.jpg

Per second:由pIn输入变量Attribute Value作为1秒钟所旋转的角度值X,乘上一个Frame所花费时间,在pOut输出Y(旋转角度值)。

 

  T X(pIn) * Elapsed Time = Y(pOut) Rotate:设定Target-即Building Blocks所输出物体Object Picked。

 

  于Angle of Rotation的pIn输入旋转角度值Y,设定Axis of Rotation-Y轴;设定Referential of the Axis--NULL-以World坐标轴为参考 (如图标)。

8.jpg

  • 暂无资料
  • 暂无资料
  • 暂无资料
  • 暂无资料
  • 暂无资料