Skip to content
Mithi Sevilla edited this page Aug 31, 2020 · 11 revisions

A small package to transform declared 3d data (points, polygons, lines) to 2d data. The output is intended to be fed to a bare-minimum-2d plot.

But you can checkout a demo application in: https://mithi.github.io/hello-3d-world/ and play with the parameters.

This is how you use it:

import BareMinimum2d from "@mithi/bare-minimum-2d"
import renderScene from "@mithi/bare-minimum-3d"

const { container, data } = renderScene(
        viewSettings,
        sceneSettings,
        sceneOptions,
        data3d
    )

## Limitations

This library does not perform [clipping](https://www.gabrielgambetta.com/computer-graphics-from-scratch/clipping.html) or [hidden surface removal](https://www.gabrielgambetta.com/computer-graphics-from-scratch/hidden-surface-removal.html). It would be best to implement the **painter’s algorithm**, **back face culling**, and **depth buffering** , but this is not a priority in the foreseeable future.


<BareMinimum2d {...{container, data} />

These are the shapes of viewSettings, sceneSettings, and sceneOptions. Here is a concrete example. This is an example of the data you pass in (data3d). And finally, this is what the function renderScene spits out, which you are expected to feed to the BareMinimum2d component.

Clone this wiki locally