Skip to content
Mithi Sevilla edited this page Sep 1, 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. See also: Why I created this project

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
    )

<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.

Limitations

This library does not perform clipping or hidden surface removal. 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.

Clone this wiki locally