DKSHOP COMMAND REFERENCE

BASIC3D COMMANDS

DK INTERSECT LIMB

This command will return the distance to the point of intersection between two coordinates, in reference

to the specified limb. Use this command to project a line from your current position to a destination to

determine whether a collision will occur with a limb. Ideal for bullet calculations and fast manual

polygon collision. Number of intersected polygon and its normals can be retrieved using the command DK GET PICK POLY.

SYNTAX:

Return Float = DK INTERSECT LIMB( Object Number, Limb Number, X, Y, Z, ToX, ToY, ToZ )

DK PICK LIMB

This command will return the Limb Number of the closest limb at the specified screen coordinates. The

limbs that are tested against the 2D coordinate are only those within the Limb Start and Limb End

range in order to speed up specific tests. If no limb exists at the coordinate, a value -1 is returned.

If a limb number is returned, additional data will be generated and stored internally. This extra data can

be retrieved using the GET PICK VECTOR and GET PICK DISTANCE commands. Number of intersected polygon and its normals can be retrieved using the command DK GET PICK POLY.

SYNTAX:

Return Integer = DK PICK LIMB( Camera Number, X, Y, Object Number, Limb Start, Limb End )

SYSTEM COMMANDS

DK GET PICK POLY

This command will return number of picked polygon. This data is generated when the DK INTERSECT LIMB, DK PICK LIMB, DK INTERSECT MATRIX and DK PICK MATRIX commands are used. Addition resulting values (polygon normals) can be retrieved using the command GET PICK VECTOR.

SYNTAX:

Return Integer = DK GET PICK POLY()

CAMERA COMMANDS

DK GET CAMERA FOV

This command will return the field of view value of the camera.

SYNTAX:

Return Float=DK GET CAMERA FOV( Camera )

DK GET CAMERA NEAR

This command will return the Near value of the camera. The Near value specifies the closest point beyond which the camera starts to draw the 3D scene.

SYNTAX:

Return Float=DK GET CAMERA NEAR( Camera )

DK GET CAMERA FAR

This command will return the Far value of the camera. The Far value specifies the furthest point beyond which the camera stops drawing the 3D scene.

SYNTAX:

Return Float=DK GET CAMERA FAR( Camera )

DK GET CAMERA VIEW X

This command will return the X value of the viewport of the camera. The viewport is the actual area on screen where all 3D is drawn.

SYNTAX:

Return Integer=DK GET CAMERA VIEW X( Camera )

DK GET CAMERA VIEW Y

This command will return the Y value of the viewport of the camera. The viewport is the actual area on screen where all 3D is drawn.

SYNTAX:

Return Integer=DK GET CAMERA VIEW Y( Camera )

DK GET CAMERA VIEW WIDTH

This command will return the Width value of the viewport of the camera. The viewport is the actual area on screen where all 3D is drawn.

SYNTAX:

Return Integer=DK GET CAMERA WIDTH( Camera )

DK GET CAMERA VIEW HEIGHT

This command will return the Height value of the viewport of the camera. The viewport is the actual area on screen where all 3D is drawn.

SYNTAX:

Return Integer=DK GET CAMERA HEIGHT( Camera )

DK GET CAMERA ASPECT

This command will return the Aspect Ratio value of the camera.

SYNTAX:

Return Float=DK GET CAMERA ASPECT( Camera )

DK CONVERT 3D TO 2D

This command will return the current screen coordinate of the specified 3D coordinate, even if the 3D coordinate is not actually within the borders of the screen. The resulting vector is generated internally and can be retrieved using the GET PICK VECTOR commands and the addition resulting value (the distance from the 3D coordinate to the camera plane) can be retrieved using the command GET PICK DISTANCE.

SYNTAX:

DK CONVERT 3D TO 2D Camera Number, X Value, Y Value, Z Value

DK CONVERT 3D TO 2D Camera Number, Vector3Source

DK CONVERT 2D TO 3D

This command will calculate a relative 3D coordinate from a 2D screen coordinate. The additional Distance parameter indicates how far into the screen the 3D coordinate is to be calculated. The resulting 3D coordinate is a world position. The resulting vector is generated internally and can be retrieved using the GET PICK VECTOR.

SYNTAX:

DK CONVERT 2D TO 3D Camera Number, Screen X, Screen Y, Distance

MATRIX COMMANDS

DK INTERSECT MATRIX

This command will return the distance to the point of intersection between two coordinates, in reference

to the specified matrix. Use this command to project a line from your current position to a destination to

determine whether a collision will occur with a matrix. Number of intersected polygon and its normals can be retrieved using the command DK GET PICK POLY.

SYNTAX:

Return Float = DK INTERSECT MATRIX( Matrix Number, X, Y, Z, ToX, ToY, ToZ )

DK PICK MATRIX

This command will return the Matrix Number of the closest matrix at the specified screen coordinates. The

matrices that are tested against the 2D coordinate are only those within the Matrix Start and Matrix End

range in order to speed up specific tests. If no matrix exists at the coordinate, a value of zero is returned.

If a matrix number is returned, additional data will be generated and stored internally. This extra data can

be retrieved using the GET PICK VECTOR and GET PICK DISTANCE commands. Number of intersected polygon and its normals can be retrieved using the command DK GET PICK POLY.

SYNTAX:

Return Integer = DK PICK MATRIX( Camera Number, X, Y, Matrix Start, Matrix End )

3DMATHS COMMANDS

DK GET MATRIX4 ELEMENT

This command will return the value of specified matrix4 element. Element index should be in range from 0 to 15.

SYNTAX:

Return Float = DK GET MATRIX4 ELEMENT( Matrix4Source, Element Index )

DK SET MATRIX4 ELEMENT

This command will set the value of specified matrix4 element. Element index should be in range from 0 to 15.

SYNTAX:

DK SET MATRIX4 ELEMENT Matrix4Result, Element Index, Value

DK SET PROJECTION MATRIX4

This command will set the projection matrix of the camera with specified matrix4.

SYNTAX:

DK SET PROJECTION MATRIX4 Camera Number, Matrix4Source

DKShop

Copyright © 2005-2009, Dmitry Kuschev

dkshop@gmail.com

dmitr0s@newmail.ru