Shapes Transform

This transform takes two optional image inputs and produces a three-dimensional (3-D) shape with the images textured onto the shape. If no images are specified, the resulting shape does not have a textured surface, and instead is a uniform color. The shape still has texture coordinates, however, so that a user can add a texture to the shape after the transform constructs it.

If two inputs are specified, the first is textured onto the front and the second is textured onto the back. If a single input is specified, it is textured onto both the front and back of the shape. The KeepAspectRatio property indicates whether the texturing preserves the aspect ratio of the specified images. Setting this property to TRUE will avoid any artificial distortion of the textured image.

The supported shapes include sheet, disc, cylinder, cone, sphere and hemisphere. The cylinder, cone, sphere, and hemisphere are surfaces of revolution, produced by revolving a line segment around the y-axis. Their texturing coordinates start at the x-y plane of intersection with the surface, and move to positive values in a clockwise fashion. If such shapes are created at this starting y-line and flattened in a counterclockwise fashion into the x-y plane, you obtain a similar layout to the original image.

The following list contains details specific to each of the shapes.

The cylinder and cone do not have the top or bottom enclosing disks, allowing the user to construct either a disk or a hemisphere as bottom or top. Constructing a composite shape in this manner also gives better flexibility for texturing the different parts with different images. The same is true for constructing a cube from six sheets, specifying a different texture for each sheet.

Note  To use this transform, you need to have Microsoft Windows® 98 Second Edition or Windows 2000 installed.

Transform Specifications

The following table contains the information you need in order to use this transform in C++ and script.

Class identifier (CLSID) CLSID_Shapes
Globally unique identifier (GUID) 8241F015-84D3-11d2-97E6-0000F803FF7A
Programmatic identifier (ProgId) DX3DTransform.Microsoft.Shapes
Category identifier (CATID) CATID_DX3DTransform
Custom interfaces IDXTShapes
Supported interfaces None
Inputs One or two optional image inputs of type IDXSurface.
Output Direct3DRMMeshBuilder3

Custom Properties

The following table lists the custom properties that control the transform output.

Property Type Default Description
XMinRes integer 10 Minimum number of mesh subdivisions in the x-direction.
XMaxRes integer 20 Maximum number of mesh subdivisions in the x-direction.
YMinRes integer 10 Minimum number of mesh subdivisions in the y-direction.
YMaxRes integer 20 Maximum number of mesh subdivisions in the y-direction.
KeepAspectRatio Boolean TRUE Specifies whether to preserve the aspect ratio of images while texturing. If TRUE, the aspect ratio is preserved. This property is only relevant for sheet, disc, and cylinder shapes.
DoubleSided Boolean TRUE Specifies whether to create both an inside and outside face. If FALSE, only an outside face is created.
Color BSTR #FFFFFFFF A string that selects color of the shape's surface if no texture is specified. The color is specified in #AARRGGBB hexadecimal format, where AA is the hexadecimal alpha value, RR is the hexadecimal value for red, GG is the hexadecimal value for green, and BB is the hexadecimal value for blue. The color can also be specified with standard HTML color strings such as red, blue, and yellow.
Shape BSTR SHEET The shape to create. Possible values are SHEET, DISC, CYLINDER, CONE, SPHERE, and HEMISPHERE. See above for details on each shape.

Remarks

This transform supports the Quality property on the IDXTransform interface. It linearly maps this property value to obtain two values within the ranges of XMinRes to XMaxRes and YMinRes to YMaxRes, respectively. The transform uses these values as the number of mesh subdivisions in the x-direction and y-direction of the generated shapes.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.