Index

PowerDoc Objects

3D Model

Overview

This object represents a visual representation of a 3D model. 3D models can be viewed from any angle and distance and drawn using a perspective or orthographic projection, while taking into account many different rendering settings.

Designated Rendering Function: pdDraw3DModel (32)

pd3DModelSettingsPtr (1182)

Link to the 3D Model Settings object.

pd3DModelDataPtr (1183)

Link to the 3D Model Data object.

Properties

pdDw (1029)   PD_LONG_SIGNED

Also appears in: PowerFont Record, PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Grid, Gradient, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image

In general, this property represents the width of a line, shape or some other object in document units. Most objects assume a positive width. However, some objects (e.g. lines) can have either a positive or a negative width. In these cases, this property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts it refers to the font's base width (or horizontal units per em-square). Similarly, in PowerFont records this property serves as the advance width of a glyph.

Sample values:

500 = Width of 500 document units
-200 = Width of -200 document units

pdDh (1030)   PD_LONG_SIGNED

Also appears in: PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Grid, Gradient, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image

In general, this property represents the height of a line, shape or other object in document units. Most objects assume a positive height. But some objects (e.g. lines) can have either a positive or a negative height. In these cases, the height property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts this property refers to the font's base height (or vertical units per em-square).

Sample values:

400 = Height of 400 document units
-100 = Height of -100 document units

Example

C/C++

DT_ID_SLONG obj[3];

obj[0] = pdObjAdd(doc, 0, "3D Model Settings");
obj[1] = pdObjAdd(doc, 0, "3D Model Data");
obj[2] = pdObjAdd(doc, 0, "3D Model");

/* Properties for object 0 */
pdPropAdd(doc, obj[0], pd3DPos, "524288, 1205862, 10092544", PD_ARR_LONG_SIGNED);
pdPropAdd(doc, obj[0], pd3DRot, "-9594470, -102078874, 0", PD_ARR_LONG_SIGNED);
pdPropAdd(doc, obj[0], pd3DMul, "262144, 262144, 262144", PD_ARR_LONG_SIGNED);
pdPropAdd(doc, obj[0], pd3DMiscBits, "0", PD_LONG_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DRasterizer, "0", PD_BYTE_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DQuality, "3", PD_BYTE_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DShading, "1", PD_BYTE_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DCulling, "0", PD_BYTE_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DClipping, "1", PD_BYTE_UNSIGNED);
pdPropAdd(doc, obj[0], pd3DTranspThreshold, "128", PD_BYTE_UNSIGNED);

/* Properties for object 1 */
pdPropAdd(doc, obj[1], pd3DModelData,
"44454E454D4B4F2D33444D4F44454C312D4F424A000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000001200000000000000000080BF00000000000000C100"
"0000C1000000C100000041000000C1000000C100000041000000C10000004100000000"
"00000000FFC80000FF000000FFFF0000FFFF000000000000000080BF00000000000000"
"C1000000C1000000C100000041000000C100000041000000C1000000C1000000410000"
"000000000000FFC80000FF000000FFFF0000FFFF00000000803F000000000000000000"
"000041000000C1000000C10000004100000041000000C1000000410000004100000041"
"000000000000000080FF000080FF000080FF000080FF00000000803F00000000000000"
"0000000041000000C1000000C100000041000000410000004100000041000000C10000"
"0041000000000000000080FF000080FF000080FF000080FF0000000000000000803F00"
"0000000000004100000041000000C1000000C100000041000000C1000000C100000041"
"000000410000000000000000FF800000FF800000FF800000FF80000000000000000080"
"3F000000800000004100000041000000C1000000C10000004100000041000000410000"
"0041000000410000000000000000FF800000FF800000FF800000FF800000000080BF00"
"00000000000000000000C100000041000000C1000000C1000000C1000000C1000000C1"
"000000C100000041000000000000000000FFFF0000FFFF0000FFFF0000FFFF00000080"
"BF0000000000000000000000C100000041000000C1000000C1000000C1000000410000"
"00C10000004100000041000000000000000000FFFF0000FFFF0000FFFF0000FFFF0000"
"000000000000000000803F000000C1000000C10000004100000041000000C100000041"
"000000410000004100000041000000000000000000FF800000FF800000FF800000FF80"
"0000000000000000000000803F000000C1000000C10000004100000041000000410000"
"0041000000C10000004100000041000000000000000000FF800000FF800000FF800000"
"FF80000000000000000000000080BF00000041000000C1000000C1000000C100000041"
"000000C10000004100000041000000C1000000000000000000FF000000FF000000FF00"
"0000FF00000000000000000000000080BF00000041000000C1000000C1000000C10000"
"00C1000000C1000000C100000041000000C1000000000000000000FF000000FF000000"
"FF000000FF000000000000000080BF000000009A9959C19A9959C19A9959C19A995941"
"9A9959C19A9959C19A9959419A9959C19A995941000000000000000080800014808000"
"14808000148080001400000000000080BF000000009A9959C19A9959C19A9959C19A99"
"59419A9959C19A9959419A9959C19A9959C19A99594100000000000000008080001480"
"80001480800014808000142FF9643F2FF9E43E000000809A9959419A9959C19A9959C1"
"000000009A995941000000009A9959419A9959C19A9959410000000000000000408000"
"144080001440800014408000142FF964BF2FF9E43E00000000000000009A9959410000"
"00009A9959C19A9959C19A9959C19A9959C19A9959C19A995941000000000000000000"
"808014008080140080801400808014000000802FF9E43E2FF9643F9A9959C19A9959C1"
"9A9959419A9959419A9959C19A995941000000009A9959410000000000000000000000"
"0000804014008040140080401400804014000000002FF9E43E2FF964BF9A9959419A99"
"59C19A9959C19A9959C19A9959C19A9959C1000000009A995941000000000000000000"
"00000000800014008000140080001400800014", PD_HEX);

/* Properties for object 2 */
pdLinkAdd(doc, obj[2], pd3DModelDataPtr, obj[1]);
pdLinkAdd(doc, obj[2], pd3DModelSettingsPtr, obj[0]);
pdPropAdd(doc, obj[2], pdDw, "550", PD_LONG_SIGNED);
pdPropAdd(doc, obj[2], pdDh, "550", PD_LONG_SIGNED);



/* Image placement */
pdImgAddPlus(doc, obj[2], 0, 50, 50, 0, 0, 0, pdDraw3DModel, DV_NULL);

INTEGRAL DSL

/* Lambda shortcuts */

local o = @(label = "") CDTObj(::my.doc, label); /* to make object */
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len); /* to add property - general */
local s = @(id, str) CDTPropStr(id, str); /* to add property - string */
local i = @(id, num) CDTPropInt(id, num); /* to add property - integer */
local l = @(id, obj) CDTLink(id, obj); /* to add link */

/* Objects */

local obj_0 = o("3D Model Settings");
local obj_1 = o("3D Model Data");
local obj_2 = o("3D Model");

/* Object Properties */

obj_0 + p(pd3DPos, "524288, 1205862, 10092544") + p(pd3DRot, "-9594470, -102078874, 0") + p(pd3DMul, "262144, 262144, 262144") + p(pd3DMiscBits, "0") + p(pd3DRasterizer, "0") + p(pd3DQuality, "3") + p(pd3DShading, "1") + p(pd3DCulling, "0") + p(pd3DClipping, "1") + p(pd3DTranspThreshold, "128");

obj_1 + p(pd3DModelData, @"
44454E454D4B4F2D33444D4F44454C312D4F424A000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000001200000000000000000080BF00000000000000C100
0000C1000000C100000041000000C1000000C100000041000000C10000004100000000
00000000FFC80000FF000000FFFF0000FFFF000000000000000080BF00000000000000
C1000000C1000000C100000041000000C100000041000000C1000000C1000000410000
000000000000FFC80000FF000000FFFF0000FFFF00000000803F000000000000000000
000041000000C1000000C10000004100000041000000C1000000410000004100000041
000000000000000080FF000080FF000080FF000080FF00000000803F00000000000000
0000000041000000C1000000C100000041000000410000004100000041000000C10000
0041000000000000000080FF000080FF000080FF000080FF0000000000000000803F00
0000000000004100000041000000C1000000C100000041000000C1000000C100000041
000000410000000000000000FF800000FF800000FF800000FF80000000000000000080
3F000000800000004100000041000000C1000000C10000004100000041000000410000
0041000000410000000000000000FF800000FF800000FF800000FF800000000080BF00
00000000000000000000C100000041000000C1000000C1000000C1000000C1000000C1
000000C100000041000000000000000000FFFF0000FFFF0000FFFF0000FFFF00000080
BF0000000000000000000000C100000041000000C1000000C1000000C1000000410000
00C10000004100000041000000000000000000FFFF0000FFFF0000FFFF0000FFFF0000
000000000000000000803F000000C1000000C10000004100000041000000C100000041
000000410000004100000041000000000000000000FF800000FF800000FF800000FF80
0000000000000000000000803F000000C1000000C10000004100000041000000410000
0041000000C10000004100000041000000000000000000FF800000FF800000FF800000
FF80000000000000000000000080BF00000041000000C1000000C1000000C100000041
000000C10000004100000041000000C1000000000000000000FF000000FF000000FF00
0000FF00000000000000000000000080BF00000041000000C1000000C1000000C10000
00C1000000C1000000C100000041000000C1000000000000000000FF000000FF000000
FF000000FF000000000000000080BF000000009A9959C19A9959C19A9959C19A995941
9A9959C19A9959C19A9959419A9959C19A995941000000000000000080800014808000
14808000148080001400000000000080BF000000009A9959C19A9959C19A9959C19A99
59419A9959C19A9959419A9959C19A9959C19A99594100000000000000008080001480
80001480800014808000142FF9643F2FF9E43E000000809A9959419A9959C19A9959C1
000000009A995941000000009A9959419A9959C19A9959410000000000000000408000
144080001440800014408000142FF964BF2FF9E43E00000000000000009A9959410000
00009A9959C19A9959C19A9959C19A9959C19A9959C19A995941000000000000000000
808014008080140080801400808014000000802FF9E43E2FF9643F9A9959C19A9959C1
9A9959419A9959419A9959C19A995941000000009A9959410000000000000000000000
0000804014008040140080401400804014000000002FF9E43E2FF964BF9A9959419A99
59C19A9959C19A9959C19A9959C19A9959C1000000009A995941000000000000000000
00000000800014008000140080001400800014");

obj_2 + l(pd3DModelDataPtr, obj_1) + l(pd3DModelSettingsPtr, obj_0) + p(pdDw, "550") + p(pdDh, "550");

/* Image Pinning */

obj_2.Pin(0, 50, 50, pdDraw3DModel);
 

Index