Skip to content

Ships and Stations ​

Ships, stations and other made things: 3D models (the built-in ships and starbases, or your own glTF files) and the Borg cube. The keys every object takes (id, at, rotation, opacity, visible ...) are on the Objects page.

model ​

A 3D model from a glTF file (.glb or .gltf): a starship, a station, or anything else made as a model. It is drawn as a hologram by default: a glow with a bright rim, scanlines and its feature edges.

  • material: original shows the file's own materials instead, lit.
  • Leave out size to draw the model at its real size; give size to scale it to fit.
  • Your own file goes in /config/www/ and is /local/... in src. Where to put it, how to pick it and how to keep it light are on Your own models.
yaml
type: custom:lcards-astrometrics-card
height: 340
camera:
  views:
    v:
      target: [0, 0, 0]
      yaw: 150
      tilt: 20
      distance: 130
backdrop:
  stars:
    count: 1500
objects:
  # a hologram with a scan band and its animation looping
  - type: model
    id: refit
    src: builtin:constitution_class_refit
    at: [-30, 0, 0]
    size: 55
    scan:
      period: 5
    animation: all
  # the file's own materials, lit
  - type: model
    id: galaxy
    src: builtin:galaxy_class
    at: [30, 0, 0]
    size: 55
    material: original
More about model
  • While it loads: a stand-in box shows until the file is in.
  • Compression: files compressed with meshopt load. Draco-compressed files do not load; the browser console says why.
  • Big models: feature edges are left off on a model over 250,000 triangles, because working them out freezes the page for seconds. edges: true draws them anyway. See make it light.
  • Labels behind it: a model hides labels and cards behind it by its real shape, not by a bounding sphere. See Points on a model.
KeyTypeDefaultDescription
srcstringrequiredThe file. builtin:<name> is a model shipped with LCARdS (see built-in models); your own is /local/...
sizenumberreal sizeIts largest extent, scene units: the file is scaled and centred to fit. Left out: its real size
lengthnumber-Its real length in metres (its largest extent), for a file not made at its true scale. See real size
file_unitsstringmThe units the file was made in, for its real size: m, cm, mm, km, ft or in
materialstringhologramhologram: a glow with a bright rim and scanlines. original: the file's own materials, lit
colorcolourvar(--lcars-blue)The hologram's body colour
rim.colorcolourvar(--lcards-moonlight)The hologram's rim colour
opacitynumber0.85The hologram's brightness, 0 to 1
scanlinesnumber0.5Scanline strength, 0 (none) to 1
solidbooleantruetrue: the hologram hides its own far side. false: see-through
blendstringaddThe hologram's blending: add or normal
scan.periodnumber0A bright band sweeping along the model, seconds per sweep. 0: none. Stops under reduced motion
scan.colorcolourvar(--lcards-moonlight)The scan band's colour
edgesboolean / objecton for a hologramFeature edges as lines. Off with material: original, and on a model over 250,000 triangles
edges.anglenumber30Draw an edge where faces meet at more than this angle, degrees
edges.widthnumber1Edge width, px. Above 1 the edges are thick lines that keep their width on any screen; 1 draws thin hairlines, the cheapest on detailed models
edges.colorcolourthe rim colourEdge colour
animationstring / list-Clips to loop: all, a clip name or a list of names. Both built-in ships have one clip, bussards
occludebooleantrueHide labels and cards behind it

Points on a model ​

A point with object: set to a model's id stands on that model: a label on the bridge, a marker on a nacelle. The point moves and turns with the model.

  • xyz is then in the file's own coordinates, so changing size never moves the points.
  • part: puts a point on a named part of the file (a node), so it follows that part when an animation moves it. With part, xyz is an offset from the part.
  • Labels on the far side of the model hide behind it: drag to turn the ship below until the port nacelle is behind the hull, and its label goes.
yaml
type: custom:lcards-astrometrics-card
height: 380
camera:
  view: three
  views:
    three:
      target: [0, -6, 0]
      yaw: 145
      tilt: 22
      distance: 105
backdrop:
  stars:
    count: 1500
points:
  - id: bridge
    object: ship
    part: bridge
    label: BRIDGE
    marker: dot
    style: major
  - id: deflector
    object: ship
    part: deflector
    label: DEFLECTOR
    marker: dot
  - id: port
    object: ship
    part: nacelle_port
    label: PORT NACELLE
    marker: dot
  - id: starboard
    object: ship
    part: nacelle_starboard
    label: STARBOARD NACELLE
    marker: dot
objects:
  - type: grid
    shape: disc
    radius: 70
    pattern: polar
    line_spacing: 10
    spoke_count: 24
    at: [0, -25, 0]
  - type: model
    id: ship
    src: builtin:constitution_class_refit
    size: 70
    scan:
      period: 5
    animation: all
More about points on a model
  • In the Astrometrics Studio: Pick on preview places a point on the model's surface, and the part list fills in from the file.
  • How models hide labels: by their real shape, from a small depth image of the scene that is taken only when the camera or the model moves.
  • More placement forms for points are on the Points page.
KeyTypeDefaultDescription
objectstring-On the point: the id of the model it stands on
xyz[x, y, z]-On the point: where it sits, in the file's own coordinates (with part: an offset from the part)
partstring-On the point: the name of a part (node) of the model; the point follows it. A model's parts are listed under built-in models

Real size ​

A model without size, in a scene with units, is drawn at its real size. Ships and stations then sit in proportion to each other and to the planets.

  • The scene needs units (or the model must be in a star system that has them). Without units, a model without size is drawn 50 scene units across.
  • The file is read in file_units: metres by default, as glTF files and the built-in models are.
  • For a file not made at its true scale, give its real length in metres and it is drawn that long, whatever the file measures. size wins over both; set it to draw a model larger on purpose.
yaml
type: custom:lcards-astrometrics-card
height: 340
units: km
camera:
  views:
    v:
      target: [0, 0, 0]
      yaw: 30
      tilt: 20
      distance: 2.6
backdrop:
  stars:
    count: 1500
points:
  - id: ds9
    xyz: [0, 0, 0]
  - id: ship
    xyz: [0.9, 0.2, 0.6]
    label: NCC-1701-A
    style: minor
objects:
  # Deep Space 9, 1.45 km across
  - type: model
    id: station
    src: builtin:deep_space_nine
    at: ds9
    material: original
  # the refit Constitution-class ship, 0.305 km long
  - type: model
    id: ship
    src: builtin:constitution_class_refit
    at: ship
More about real size
  • In proportion: the Constitution-class ship is 0.305 km long beside Deep Space 9's 1.45 km, round a planet 12,742 km across.

  • Downloaded models: many are not made at their true scale. A Star Trek Online Odyssey-class ship from Sketchfab measures 53 units long, so read as metres it would be drawn 53 m long. Give it its real length in metres (the Odyssey is 1,061 m).

  • Any units: length stays right in any scene units, where a size would need changing with them.

  • Your own files, with a file made in feet and one at an odd scale:

    yaml
    objects:
      # a download made in feet
      - type: model
        id: runabout
        src: /local/models/runabout.glb
        at: [1, 0, -1]
        file_units: ft
      # a download at an odd scale: its real length in metres
      - type: model
        id: odyssey
        src: /local/models/odyssey.glb
        at: [-3, 0, 2]
        length: 1061
  • In the Astrometrics Studio: the model's form shows what its file measures and how it is drawn. A file read at its own measurements says to set Length (m) when it is not at its true scale. Show flies the preview to the model, Fit to view sets a size about a fifth of the preview's view, File size sets its largest extent as the size (for a file made in the scene's units) and Real size clears size.

  • New models: a new model in a scene with units starts at its real size, and the preview flies to it once its file is in (and again when you pick another file), so a real-size ship is never a lost speck.

KeyTypeDefaultDescription
unitsstring-On the card: what one scene unit is (m, km, au, ly or pc). See Scale
sizenumber-Wins over the real size: its largest extent, scene units
lengthnumber-Its real length in metres. Wins over file_units
file_unitsstringmThe units the file was made in: m, cm, mm, km, ft or in

Visible size ​

At its real size a ship is a speck in a view of a whole star system. model_scale: visible on the card draws it large enough to see.

  • Each model is drawn at least 40 px across, scaled about its centre, and at its real size again once you are close enough for that to be larger.
  • Only real-size models grow: a model with its own size is left as it is. Points on a model grow with it.
  • You can switch it on screen with the size button under the camera buttons, the V key, a set-model-scale action or the Astrometrics Studio's toolbar. That is not saved.
yaml
type: custom:lcards-astrometrics-card
height: 340
units: km
model_scale: visible
camera:
  views:
    v:
      target: [15, 0, 5]
      yaw: 20
      tilt: 30
      distance: 90
backdrop:
  stars:
    count: 1500
points:
  - id: ds9
    xyz: [0, 0, 0]
    label: DEEP SPACE 9
    style: minor
  - id: ship
    xyz: [30, 0, 10]
    label: NCC-1701-A
    style: minor
objects:
  - type: model
    id: station
    src: builtin:deep_space_nine
    at: ds9
    material: original
  - type: model
    id: ship
    src: builtin:constitution_class_refit
    at: ship
KeyTypeDefaultDescription
model_scalestringrealOn the card: how real-size models start. real: in proportion, however small. visible: at least 40 px across
camera.buttons.scalebooleantrueThe size button beside the camera buttons, shown only when a model is drawn at its real size. false hides it
model_scale (action)stringtoggleOn a set-model-scale action: real, visible or toggle. See actions

Built-in models ​

Ships and stations shipped with LCARdS: fan art made in code (no third-party model), recreating the designs seen on screen. Use one in src as builtin:<name>.

  • All of them are in metres, with Y up, so they come in at their real size.
  • material: original shows their own colours and lit windows.
  • Both ships use one set of part names, so a scene that labels bridge or nacelle_port works with either.
  • Rings, rims and round hulls put their part point on the front face (+z), so a label sits on the structure rather than in the middle of the station.
yaml
type: custom:lcards-astrometrics-card
height: 420
camera:
  view: station
  views:
    station:
      target: [0, 0, 0]
      yaw: 30
      tilt: 10
      distance: 170
backdrop:
  stars:
    count: 1500
points:
  - id: ops
    object: ds9
    part: ops
    label: OPS
    marker: dot
    style: major
  - id: promenade
    object: ds9
    part: promenade
    label: PROMENADE
    marker: dot
  - id: pylon
    object: ds9
    part: upper_pylon_1
    label: UPPER PYLON 1
    marker: dot
objects:
  - type: model
    id: ds9
    src: builtin:deep_space_nine
    size: 90
    material: original
More about the built-in models
  • Parts on the front face: the rings, rims and round hulls with their point on the front face are habitat_ring, docking_ring, cap, promenade, underdish, neck and hull.
  • Your own files: for the My models folder, picking a file, sizing and turning it, and keeping a big model light, see Your own models.
srcWhat it isParts (part:)
builtin:constitution_class_refitThe refit Constitution-class starship of the films (USS Enterprise NCC-1701-A): 305 m long, 144.5 m across the saucer, the bow toward +z. One animation clip, bussards (the collectors pulse).saucer, bridge, sensor_dome, impulse, impulse_exhaust, neck, torpedo_launcher, secondary_hull, deflector, shuttle_bay, pylon_port, pylon_starboard, nacelle_port, nacelle_starboard, bussard_port, bussard_starboard, grille_port, grille_starboard, windows
builtin:galaxy_classThe Galaxy-class starship of The Next Generation (USS Enterprise NCC-1701-D): 642.5 m long, about 470 m across the saucer, the bow toward +z. One animation clip, bussards.the same names as the Constitution, without sensor_dome
builtin:deep_space_nineDeep Space 9 (Terok Nor), the Cardassian station of Deep Space Nine: 1452 m across, the docking pylons 969 m tip to tip.ops, upper_core, promenade, lower_core (its bottom tip), sail_towers, spokes (three thin ones, between the bridges), habitat_ring, docking_ring, crossover_bridges (three), docking_ports, windows, upper_pylon_1 to upper_pylon_3 and lower_pylon_1 to lower_pylon_3 (their tips)
builtin:earth_spacedockEarth Spacedock, from Star Trek III: The Search for Spock onward: 3800 m across and about 5480 m tall.antennas (the top), cap, space_doors (the front door), underdish, neck, hull, stem, base (the sphere), towers (their tips, the bottom), panels, windows
builtin:utopia_planitia_drydockA drydock of the Utopia Planitia Fleet Yards over Mars, sized for a Galaxy-class ship: about 760 m long, the bow end toward +z. Place several for the yards.frame (ribs and rails), deck, keel, lights, berth (where a ship sits), bow, stern

cube ​

A Borg cube, the same one as the Borg screen effect draws, or a plain shaded box. It has machinery carved into every face, a rail lattice over it, green light from the recesses and glow spots pulsing deep inside.

  • It sits in the scene like any object: it turns with rotation and spin, other objects pass into its recesses, and labels behind it hide.
  • For the cube's green halo, put a glow at the same point.
  • For many cubes or a slow tablet, use detail: false.
yaml
type: custom:lcards-astrometrics-card
height: 380
camera:
  views:
    v:
      target: [8, 0, 0]
      yaw: 35
      tilt: 20
      distance: 75
backdrop:
  stars:
    count: 1500
points:
  - id: cube
    xyz: [0, 0, 0]
  - id: name
    at: cube
    offset: [0, 18, 0]
    label: BORG CUBE
    style: major
objects:
  # the Borg cube with a glow behind it for its halo
  - type: glow
    at: cube
    size: 60
    color: var(--lcards-green-medium)
    opacity: 0.5
  - type: cube
    at: cube
    size: 20
    spin: 5
  # a plain box
  - type: cube
    shape: box
    at: [30, -5, 0]
    size: [8, 4, 12]
More about the cube
  • Reduced motion: the glow spots pulse on the scene clock, so they hold still under reduced motion.
  • Cost: the carved cube costs about as much as the screen effect's cube for the pixels it covers. One cube filling the card is fine on a laptop.
KeyTypeDefaultDescription
shapestringborgborg: the Borg cube. box: a shaded box with its edges
sizenumber / [x, y, z]20Scene units: one number for a cube, or [x, y, z] for a box
colorcolourvar(--lcards-green-medium) (borg), var(--lcards-gray-medium) (box)borg: the light from inside and the hull's tint. box: the box
glow.colorcolourvar(--lcards-green-lightest)borg: the glow spots
detailbooleantrueborg: true carves the machinery into the faces; false draws flat faces with the lattice, for slow graphics hardware
seednumber1borg: where the glow spots sit. A different number moves them
edgesboolean / objecttruebox: draw its edges
edges.colorcolourtheme:colors.ui.secondarybox: the edge colour
opacitynumber1box: how see-through it is, 0 to 1. A Borg cube ignores it
occludebooleantrueHide labels and cards behind it

Released under the MIT License. | About