npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

outrun-renderer-3d

v0.0.1

Published

Renderer strategy for 3d

Downloads

2

Readme

outrun-renderer-3d

Renderer strategy for 3d

Motivation

Front-end / web development has radically changed with the advent of React and similiar technologies. These frameworks allow for easily componentizing code, sharing components, and testing them.

On of the most powerful ideas behind React is the idea that your UI is a pure function of your application state. Often, managing the 'stateful'-ness and the state transitions is where the warts of UI code pop up - and React lets us sidestep those problems, because it takes care of that 'stateful' heavy lifting behind the scenes, and lets us express our web application as a function of state => graphics.

This idea also comes up in the form of 2D UI, in the form of immediate-mode UIs. In the 3D space, though, the APIs tend to be a retained-mode form.

What if we could expose this same idea of pure function for 3D Graphics?

Sample

import * as React from "react"
import * as ReactDOM from "react-dom"
import { Renderer, Camera, Transform, TerrainMesh, Mesh, AmbientLight, Vector3 } from "outrun-renderer-3d"

const cameraPosition = Vector3.create(0, 2, 2)
const lookAtPosition = Vector3.create(0, 0, 0)

const flatTerrain = TerrainMesh.fromHeightFunction(32, 32, Vector2.create(-16, -16), (x, z) => 0)

const MyView = () => {
return <Renderer width={800} height={600}>
        <Camera position={cameraPosition} lookAt={lookAtPosition} fov={70} aspectRatio={800 / 600} near={0.1} far={500}>
            <AmbientLight color={0xFFFFFF} />
            <Material material={{type: "normal"}}>
                <Mesh mesh={flatTerrain} />
            </Material>
        </Camera>
      </Renderer>
}

ReactDOM.render(<MyView />, document.body)

Prior Works

This project was inspired by several other projects:

And is built on the excellent ThreeJS library by mrdoob

License

Copyright 2018 Outrun Labs, LLC.

outrun-renderer-3d is licensed under the GPL v3.0, intended for educational and non-commercial use.

For commercial use, we have alternative licenses available. Contact [email protected] for more information.

Note that bundled software, such as THREE.js, have their own set of license terms.