Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Render Scene Defaults #5

Open
mithi opened this issue Aug 30, 2020 · 0 comments
Open

feat: Render Scene Defaults #5

mithi opened this issue Aug 30, 2020 · 0 comments

Comments

@mithi
Copy link
Owner

mithi commented Aug 30, 2020

Motivation

renderScene() takes in viewSettings, sceneSettings,sceneOptions and data

Scene options has a shape that is specified here https://github.com/mithi/bare-minimum-3d/blob/master/src/parameter-types.ts You have to specify a lot of color, opacity, and lineSize among others. You may not want to think about these things.

Solution

So there should be an additional alternative function than can be used:
renderSceneDefaults(viewSettings, sceneSettings, sceneOptionsBoolean, backgroundColor, theme, data)

The user should be able to override the background color should s/he wish

The user should also be able to specify a theme which is light or dark which will use the default colors and lines etc.
The user should specify which scene option elements you want to show ie

const sceneOptionsBoolean: Record<string, boolean> = {
    showWorldAxes: true,
    showEdgeAxes: true,
    showCubeAxes: true,
    showXYplane: true,
    showCrosslines: true,
    showCubeEdges: true,
}

For the sceneOptions parameter, we can use these defaults for dark mode

const edgeAxes = {
    intersectionPointColor: "#FF00FF",
    intersectionPointSize: 5,
    xColor: "#E91E63",
    yColor: "#03A9F4",
    zColor: "#CDDC39",
    lineSize: 1,
    edgeOpacity: 1.0,
}

const worldAxes = {
    intersectionPointColor: "#FFFF00",
    intersectionPointSize: 5,
    xColor: "#E91E63",
    yColor: "#03A9F4",
    zColor: "#CDDC39",
    lineSize: 3,
    edgeOpacity: 1.0,
}

const cubeAxes = {
    intersectionPointColor: "#00FF00",
    intersectionPointSize: 5,
    xColor: "#E91E63",
    yColor: "#03A9F4",
    zColor: "#CDDC39",
    lineSize: 3,
    edgeOpacity: 1.0,
}

const sceneOptions = {
    paper: { color: "#17212B", opacity: 1 },
    xyPlane: { color: "#0652DD", opacity: 0.1 },
    sceneEdges: { color: "#1e3799", opacity: 1 },
    crossLines: { color: "#079992", opacity: 1 },
    edgeAxes,
    worldAxes,
    cubeAxes,
}
@mithi mithi changed the title feature: Render Scene Defaults feat: Render Scene Defaults Aug 30, 2020
@mithi mithi added good first issue Good for newcomers up for grabs first-timers-only help wanted Extra attention is needed and removed first-timers-only good first issue Good for newcomers help wanted Extra attention is needed up for grabs labels Aug 31, 2020
@mithi mithi pinned this issue Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant