Setup

We need to install Pine3D. To install the latest version, run the following command. This will download the library, as well as its dependencies and a few models used in the examples in the guides.
pastebin run qpJYiYs2

Small example

First, we import the library using the require method.
local Pine3D = require("Pine3D")
We can now create a new ThreeDFrame. By not specifying the size, it will be the full term size.
-- params: x1, y1, x2, y2
local ThreeDFrame = Pine3D.newFrame() -- x1, y1, x2, y2 (default is fullscreen)
We set the camera position such that the pineapple that we will render is nicely in view. Optionally, we can set the FoV. The default FoV is 90 degrees.
ThreeDFrame:setCamera(0, 0.6, 0) -- x, y, z, rotations around all axes (optional)
ThreeDFrame:setFoV(60) -- set the field of view
In order to render objects, we will define objects as a list of Object, with each a model id, x, y, z values and optionally rotations in three dimensions. Any Model stored in the model directory can be loaded, which is by default at "/models/" but can be changed with ThreeDFrame:setModelsDir.
local objects = {
  -- args: modelId, x, y, z, rotations around all axes (optional)
  ThreeDFrame:newObject("models/pineapple", 2, 0, 0, nil, math.pi*0.25, nil),
}
Now that we have a ThreeDFrame setup, and our list of Object, we can render these to the frames Buffer and then draw this buffer and sleep for a second to view the final result before the program ends.
ThreeDFrame:drawObjects(objects)
ThreeDFrame:drawBuffer()
sleep(1)

Full code

local Pine3D = require("Pine3D")

local ThreeDFrame = Pine3D.newFrame() -- x1, y1, x2, y2 (default is fullscreen)
ThreeDFrame:setCamera(0, 0.6, 0) -- x, y, z, rotations around all axes (optional)
ThreeDFrame:setFoV(60) -- set the field of view

local objects = {
  -- args: modelId, x, y, z, rotations around all axes (optional)
  ThreeDFrame:newObject("models/pineapple", 2, 0, 0, nil, math.pi*0.25, nil),
}

ThreeDFrame:drawObjects(objects)
ThreeDFrame:drawBuffer()
sleep(1)

Resulting render

final render
Pineapple