Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eanders-ms/pxt-3d
MakeCode extension for 3d transformation and projection - beta
https://github.com/eanders-ms/pxt-3d
Last synced: about 2 months ago
JSON representation
MakeCode extension for 3d transformation and projection - beta
- Host: GitHub
- URL: https://github.com/eanders-ms/pxt-3d
- Owner: eanders-ms
- License: mit
- Created: 2020-05-26T02:16:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-18T22:54:43.000Z (over 4 years ago)
- Last Synced: 2024-10-20T04:12:42.205Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 13.5 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pxt-3d ![Build status badge](https://github.com/eanders-ms/pxt-3d/workflows/MakeCode/badge.svg)
![](./media/demo.gif)
This library implements a perspective 3D renderer for MakeCode Arcade. Practical? No. Fun? Yes!
## Features
- Renders 3D objects from the perspective of a camera.
- Lighting models: None, Flat, Dither. Maybe more will come: greyscale/monochrome, dramatic multi-color dithering, additional dithering patterns, others?
- Primitives: Cube. More possibly coming: Sphere, diamond, cylinder, quad, ...
- Depth buffer (only works in simulator due to device memory constraints -- I'm in search of a solution).
- Frustum clipping (partially implemented).
- Backface culling.
- Fixed point (Fx8) linear algebra and trigonometric functions.## TODO
- [ ] Improve perspective projection.
- [ ] Find a way to support depth buffer on device -- currently getting an out-of-memory error (panic 22).
- [ ] Proper triangle/view frustum clipping (need to split triangles when partially clipped).
- [ ] Child objects / object hierarchies.
- [ ] Make a better looking demo scene. Maybe a spaceship flying through a city ala https://youtu.be/XezcZVu66QI?t=485 ?. Requires depth buffer.
- [ ] Experiment with other types of lighting. More creative palettes, greyscale, etc.
- [ ] Find performance problems and try to improve them. Goal: 30 fps when writing color to every pixel, with depth buffer.
- [ ] Or, maybe this is fine as-is, and I'll move on to the next thing :).## Use this extension
This repository can be added as an **extension** in MakeCode.
* open https://arcade.makecode.com/
* click on **New Project**
* click on **Extensions** under the gearwheel menu
* search for the URL of this repository and import## Edit this extension
To edit this repository in MakeCode.
* open https://arcade.makecode.com/
* click on **Import** then click on **Import URL**
* paste the repository URL and click import## Blocks preview
This image shows the blocks code from the last commit in master.
This image may take a few minutes to refresh.![A rendered view of the blocks](https://github.com/eanders-ms/pxt-3d/raw/master/.makecode/blocks.png)
## Supported targets
* for PXT/arcade
* for PXT/arcade
(The metadata above is needed for package search.)