A ThreeDFrame is used to store settings and the buffer for drawing. It is basically the entire rendering environment. You can use multiple at a time as well. You can create one using the Pine3D.newFrame method:
local frame = Pine3D:newFrame(x1, y1, x2, y2)


ThreeDFrame.
x1

Type: number

ThreeDFrame.
y1

Type: number

ThreeDFrame.
x2

Type: number

ThreeDFrame.
y2

Type: number

ThreeDFrame.
width

Type: number

ThreeDFrame:
setSize(x1, y1, x2, y2)

Returns: void
Name Type Description
x1 number x of starting position of the 3d rendering window
y1 number y of starting position of the 3d rendering window
x2 number x of ending position of the 3d rendering window
y2 number y of ending position of the 3d rendering window

ThreeDFrame:
setBackgroundColor(color)

Returns: void
Name Type Description
color number CC color from the colors library

ThreeDFrame:
depthInterpolation(enabled)

Returns: void
Name Type Description
enabled boolean if enabled, uses depth interpolation (default)

ThreeDFrame:
setCamera(cameraX, cameraY, cameraZ, rotX, rotY, rotZ)

Returns: void
Name Type Description
cameraX number x coordinate of the new camera position (optional)
cameraY number y coordinate of the new camera position (optional)
cameraZ number z coordinate of the new camera position (optional)
rotX number new camera rotation around the x axis (optional)
rotY number new camera rotation around the y axis (optional)
rotZ number new camera rotation around the z axis (optional)

ThreeDFrame:
setCamera(camera)

Returns: void
Name Type Description
camera PineCamera string indexed table with values for x, y, z, rotX, rotY, rotZ (all optional)

ThreeDFrame:
setFoV(FoV)

Returns: void
Name Type Description
FoV number the new field of view of the camera in degrees

ThreeDFrame:
newObject(model, x, y, z, rotX, rotY, rotZ)

Returns: object: PineObject
Name Type Description
model string or Model if string, used as path to load the serialized Model
x number x coordinate of the PineObject
y number y coordinate of the PineObject
z number z coordinate of the PineObject
rotX number rotation around the x axis (optional)
rotY number rotation around the y axis (optional)
rotZ number rotation around the z axis (optional)

ThreeDFrame:
getObjectIndexTrace(objects, x, y)

Returns: objectIndex: number, polygonIndex: number
Name Type Description
objects table of PineObject
x number x coordinate on the screen
y number y coordinate on the screen

ThreeDFrame:
map3dTo2d(x, y, z)

Returns: screenX: number, screenY: number, visible: boolean
Name Type Description
x number x coordinate in 3d space
y number y coordinate in 3d space
z number z coordinate in 3d space

ThreeDFrame:
drawObject(object, cameraAngles)

Returns: void
Name Type Description
object PineObject the PineObject to draw to the internal Buffer
cameraAngles CameraAngles CameraAngles for fast calculations. Can be dirived from CollapsedCamera

ThreeDFrame:
drawObjects(objects)

Returns: void
Name Type Description
objects number indexed table of PineObject table of objects to draw to the internal Buffer