Hologram Projector

From OpenComputers: Rebooted
Revision as of 00:10, 28 August 2026 by SoraFirestorm (talk | contribs) (Unify block and component API pages)
Jump to navigation Jump to search

Overview

This block projects a hologram in the area over it. The size of the hologram can be scaled from 1x1x1 block to 9x9x6 blocks. The number of 'voxels' will stay the same, regardless of scale though. It has resolution of 48x32x48 monochrome voxels (they can either be on or off). Each voxel in that 3D array can be set individually. Generated holograms will look like this.

The second tier of the hologram projector is also capable of displaying colored voxels - in three different colors. These colors can be set to any desired value, i.e. the color palette is editable.

The Tier 1 Hologram Projector is crafted using the following recipe:

The Tier 2 Hologram Projector is crafted using the following recipe:

Component API

Component name: hologram. Callbacks:

clear

clear()

Clears the hologram.

get

get(x:number, y:number, z:number):number

Returns the value at the specified position.

set

set(x:number, y:number, z:number, value:number or boolean)

Set the value for the specified position.

fill

fill(x:number, z:number[, minY:number], maxY:number, value:number)

Fills an interval in the specified column column with the specified value. Will overwrite only the voxels in the interval. If minY is omitted it defaults to 1. The two interval ends are inclusive.

copy

copy(x:number, z:number, sx:number, sz:number, tx:number, tz:number)

Copies an area of columns by the specified translation.

getScale

getScale():number

Returns the current render scale of the hologram.

setScale

setScale(value:number)

Set the render scale. A larger scale consumes more energy. The minimum scale is 0.33, where the hologram will fit in a single block space, the maximum scale is 3, where the hologram will take up a 9x6x9 block space.

getTranslation

getTranslation():number, number, number

Return the current translation offset.

setTranslation

setTranslation(x:number, y:number, z:number)

Set the translation vector. The hologram display will be offset by this vector from its normal location. The maximum allowable translation is a function of tier. Units are the hologram's size, so the distance translated increases and decreases with scale as well.

maxDepth

maxDepth():number

The color depth supported by the hologram.

getPaletteColor

getPaletteColor(index:number):number

Get the hex color defined for the specified value.

setPaletteColor

setPaletteColor(index:number, value:number):number

Set the hex color defined for the specified value.

Examples

Simple example program that allows setting individual voxels:

local component = require("component")
local hologram = component.hologram
local args = {...}
hologram.set(tonumber(args[1]), tonumber(args[2]), tonumber(args[3]), args[4] == "true" or args[4] == "on")

Example use (assuming it's saved as holo-set.lua): # holo-set 16 8 20 true

Further examples:

This program generates a heightmap and 'moves' across it over time, creating the effect of a flowing terrain.

This program generates a random heightmap and displays scrolling text above it.

Note, the second example is quite a bit more advanced then the first. Important: both scripts also need the [https://github.com/OpenPrograms/Sangar-Programs/blob/master/noise.lua noise.lua] script to be in the same folder.

Contents

Blocks
Computers Computer Case - Server Rack - Microcontrollers
Display Hologram Projector - Keyboard - Screen
Power and Networking Capacitor - Net Splitter - Power Converter - Power Distributor - Relay
Extensions Adapter - Cable - Disassembler - Disk Drive - Geolyzer - Motion Sensor - Redstone I/O - Transposer - 3D Printer
Robotics Assembler - Charger - Drone - Robot - Waypoint