UV对象

UV对象(是v2.8版中的新对象)压缩了很多DrawImageUV方法要用的参数,以在一个3D表面上呈现图像。这些可能涵盖在第十一章:3D表面映射

属性方法
AmbientLight
BrightnessMax
BrightnessMin
CameraAngle
CameraX
CameraY
CameraZ
DiffuseLight
DisplayImage
DisplayShading
DisplayWireframe
FlipNormals
HideBackFace
ScaleX
ScaleY
Shading
ShiftX
ShiftY
SpecularAlpha
SpecularLight
UMax
UMin
UStep
VMax
VMin
VStep
WireframeColor
WireframeThickness
XFunc
YFunc
ZFunc
ResetCamera
RotateCamera
RotateCameraAroundAxes
SetLightVector

UV属性

AmbientLight As Single (read/write)

指定周围的光源成分。Only used if Shading is True, ignored otherwise. 0.4 by default.

参见:第十一章第5节:阴影

BrightnessMax As Integer (read/write)
BrightnessMin As Integer (read/write)

Specify the mapping between shading values and the change in brightness for the corresponding pixels of the image being rendered.

参见:第十一章第5节:阴影

CameraAngle As Single (read/write)

Specifies the virtual camera's view angle (in degrees) which affects the degree of perspective. 30° by default.

参见:第十一章第4节:表面可视化

CameraX As Single (read/write)
CameraY As Single (read/write)
CameraZ As Single (read/write)

指定虚拟摄像机的位置。默认值是(5, 0, 0)。

参见:第十一章第4节:表面可视化

DiffuseLight As Single (read/write)

指定漫光源成分。只有Shadingtrue时才会使用,否则会被忽略。默认值是0.6。

参见:第十一章第5节:阴影

DisplayImage As Boolean (read/write)

Specifies whether the pixels of the image being rendered should be displayed on the 3D surface. True by default. Can be set to False for debugging purposes so that the wireframe and/or shading can be viewed by themselves. This property and DisplayShading cannot both be True.

参见:第十一章第5节:阴影

DisplayShading As Boolean (read/write)

Specifies whether the shading pattern should be displayed on the 3D surface instead of the image. False by default. Useful for debugging purposes. This property and DisplayImage cannot both be True.

参见:第十一章第5节:阴影

DisplayWireframe As Boolean (read/write)

Specifies whether the wireframe should be displayed on the 3D surface in addition to, or instead of the image/shading. False by default. Useful for debugging purposes. This property cannot be False if DisplayImage and DisplayShading are both False. The color and thickness of the wireframe are specified via the WireframeColor and WireframeThickness properties.

参见:第十一章第3节:利用UV对象指定参数方程第十一章第6节:把它们放在一起

FlipNormals As Boolean (read/write)

Specifies whether the direction of the normal vectors of all surface faces should be reversed. False by default. Depending on the way the surface is defined, the normals may be pointing towards, or away from, the camera by default. If they point in the "wrong" direction, the faces may not receive proper shading, and may also be wrongly hidden by the HideBackFace property. Set this property to True to fix those problems.

参见:第十一章第5节:阴影

HideBackFace As Boolean (read/write)

If set to True, hides the faces pointing away from the camera. False by default. This property is useful for displaying a surface that should appear wrapped around an object depicted on the background canvas, such as a pen, mug or baseball cap.

参见:第十一章第4节:表面可视化

ScaleX As Single (read/write)
ScaleY As Single (read/write)

Specify horizontal and vertical scaling factors affecting the mapping of the image being rendered to the 3D surface on which it is rendered. (1, 1) by default. These properties cannot be 0 but can be negative. A number with the absolute value greater than 1 shrinks the image along the corresponding axis into a tiling pattern, and a number with the absolute value between 0 and 1 stretches it. A negative number for ScaleX flips the image horizontally, and for ScaleY vertically.

参见:第十一章第3节:利用UV对象指定参数方程

Shading As Boolean (read/write)

Enables shading for the image being rendered. False by default. Shading greatly improves the visual perception of depth. Without it, the image may look flat.

参见:第十一章第5节:阴影

ShiftX As Single (read/write)
ShiftY As Single (read/write)

Specify the horizontal and vertical displacement of the rendered image relative to the canvas. By default, the 3D view is transferred onto the canvas in such a way that its center is positioned right over the center of the canvas. For fune-tuning purposes, the image may need to be shifted slightly up, down or sideways to match the content of the canvas. These properties help with this task.

参见:第十一章第4节:表面可视化第十一章第6节:把它们放在一起

SpecularAlpha As Single (read/write)

Specifies the "alpha" value in the Phong reflection model for the specular light component. This value affects the size of a specular highlight. Only used if Shading is True, ignored otherwise. 100 by default.

参见:第十一章第5节:阴影

SpecularLight As Single (read/write)

Specifies the specular light component. Only used if Shading is True, ignored otherwise. 0.3 by default.

参见:第十一章第5节:阴影

UMax As Single (read/write)
UMin As Single (read/write)

Specify the inclusive range for the U parameter in the parametric equations defining the 3D surface. UMax must be greater than UMin. These properties are required.

参见:第十一章第2节:参数表示的三维表面

UStep As Integer (read/write)

Specifies the number of steps for the U parameter. This property is required, and must be 1 or greater.

参见:第十一章第2节:参数表示的三维表面

VMax As Single (read/write)
VMin As Single (read/write)

Specify the inclusive range for the V parameter in the parametric equations defining the 3D surface. VMax must be greater than VMin. These properties are required.

参见:第十一章第2节:参数表示的三维表面

VStep As Integer (read/write)

Specifies the number of steps for the V parameter. This property is required, and must be 1 or greater.

参见:第十一章第2节:参数表示的三维表面

WireframeColor As Long (read/write)

Specifies the wireframe color. Only used if DisplayWireframe is True, ignored otherwise. White (&HFFFFFFFF) by default.

参见:第十一章第3节:利用UV对象指定参数方程第十一章第6节:把它们放在一起

WireframeThickness As Long (read/write)

Specifies the wireframe thickness. Only used if DisplayWireframe is True, ignored otherwise. 1 by default.

参见:第十一章第3节:利用UV对象指定参数方程第十一章第6节:把它们放在一起

XFunc As String (read/write)
YFunc As String (read/write)
ZFunc As String (read/write)

Specify the X, Y and Z mathematical equations for the 3D surface being defined. The strings may contain numbers, arithmetic operations, parentheses, parameter names, special names, and function names. These properties are required.

参见:第十一章第3节:利用UV对象指定参数方程 

UV方法

Sub ResetCamera()

Resets the camera to its default location, orientation and view angle: the coordinates are reset to (5, 0, 0), lens vector to (-1, 0, 0) and view angle to 30°.

参见:第十一章第4节:表面可视化

Sub RotateCamera(Pitch As Single, Bank As Single, Yaw As Single)

Rotates the camera around its center. Pitch is rotation around the lateral (left-to-right) axis. Bankis rotation around the longitudinal (front-to-back) axis. Yaw is rotation around the vertical axis. The method performs the rotations in the order Pitch-Bank-Yaw. The angles are specified in degrees.

参见:第十一章第4节:表面可视化

Sub RotateCameraAroundAxes(X As Single, Y As Single, Z As Single)

Rotates the camera around the three coordinate axes X, Y and Z. The method performs the rotations in the order X-Y-Z. The angles are specified in degrees.

参见:第十一章第4节:表面可视化

Sub SetLightVector(X As Single, Y As Single, Z As Single)

Specifies the direction of the light vector. By default the light vector is parallel to the X-axis and points in the opposite direction to it. The default vector values are (-1, 0, 0). The XY and Zvalues cannot all be 0. The light vector affects the way the surface is shaded.

参见:第十一章第5节:阴影

如果你喜欢这篇文章,敬请给站长打赏↑

除特别注明外,本站所有文章均为本站站长原译,转载请注明出处。