osci-render/README.md

96 wiersze
3.3 KiB
Markdown
Czysty Zwykły widok Historia

2020-02-11 22:27:16 +00:00
# osci-render
2020-01-22 23:33:22 +00:00
Program for drawing objects, text, and images on an oscilloscope using sh.ball.audio output.
2020-01-22 23:33:22 +00:00
2020-11-22 13:29:29 +00:00
This allows for 3D rendering of `.obj` files, `.svg` images, and `.txt` files.
2020-02-11 22:28:00 +00:00
2020-10-18 20:47:41 +00:00
Lots of this code was built as part of a 24hr hackathon: IC Hack 20. The original repository can be found here: https://github.com/wdhg/ICHack20 It won 'Best Newcomers Prize' at the event.
2020-02-16 17:52:28 +00:00
2020-10-18 20:47:41 +00:00
### Video Demonstration
2020-05-08 19:43:19 +00:00
2020-10-18 20:47:41 +00:00
[![osci-render demonstration](https://img.youtube.com/vi/oEX0mnv6PLM/0.jpg)](https://www.youtube.com/watch?v=oEX0mnv6PLM)
2020-06-23 20:06:09 +00:00
2020-10-18 20:47:41 +00:00
## Current Features
- Render `.obj` files on an oscilloscope
2020-11-08 22:27:37 +00:00
- Render `.svg` files
2020-11-22 13:29:29 +00:00
- Render text
2020-10-18 20:47:41 +00:00
- Rotation of objects
- Scaling image
- Translating image
## Proposed Features
- Tune and transpose sh.ball.audio output
2020-10-18 20:47:41 +00:00
- Support rendering of multiple objects
- Saving pre-rendered frames to file for later loading
- Saving sh.ball.audio output to file
2020-11-22 13:29:29 +00:00
- (long term) Implement GUI
2020-10-18 20:47:41 +00:00
- (long term) Keyframing/animating objects and camera
## Usage
Using osci-render is very easy; specify the file you would like to render, and optionally the rotation speed, and camera focal length and position in the case of `.obj` files and it will output as sh.ball.audio to visualise on your oscilloscope.
2020-10-18 20:47:41 +00:00
To render the cube example in `/models`, you would use the following args:
```
osci-render models/cube.obj 3 1
```
This will render a cube with a rotation speed of 3 and a focal length of 1. Detailed argument usage below:
### Program Arguments
```
2020-11-22 13:29:29 +00:00
osci-render objFile [rotateSpeed] [focalLength] [cameraX] [cameraY] [cameraZ]
OR
osci-render svgFile
OR
osci-render textFile [fontSvgPath]
2020-10-18 20:47:41 +00:00
```
If no camera position arguments are given, the program will automatically move the camera to a position that renders the whole object on the screen with minimal display clipping.
#### Required
2020-11-08 22:27:37 +00:00
- filePath
2020-11-22 13:29:29 +00:00
- Specifies the file path to retrieve the `.obj`, `.svg`, or `.txt` file
2020-10-18 20:47:41 +00:00
#### Optional
- rotateSpeed
- Sets the speed of rotation of the object
- focalLength
- Sets the camera's focal length
- cameraX/Y/Z
- Sets X/Y/Z position of camera
2020-11-22 13:29:29 +00:00
- fontSvgPath
- Sets the `.svg` file used as a source for the font used when text rendering
2020-10-18 20:47:41 +00:00
## Building
### Library setup
#### Libraries
2020-09-27 12:37:54 +00:00
- [XT-Audio](https://sjoerdvankreel.github.io/xt-audio/)
- [JGraphT](https://jgrapht.org/)
- [JUnit 4](https://junit.org/junit4/)
- [java-data-front](https://github.com/mokiat/java-data-front)
2020-11-22 13:29:29 +00:00
- [jsoup](https://jsoup.org/)
2020-09-27 12:37:54 +00:00
2020-10-18 20:47:41 +00:00
Open the folder in your IDE of choice (I would recommend using IntelliJ) and build/run `AudioClient` after setting up libraries as provided in `/lib`. You will additionally require a platform-specific `dll`/`so` file for XT-Audio depending if you're on a windows/linux x86/x64 OS, which you'll find in the java-xt folder in the [XT-Audio](https://sjoerdvankreel.github.io/xt-audio/) binaries.
Make sure your default playback devices are setup correctly, as XT-Audio will try and find your default device for sh.ball.audio output.
2020-10-18 20:47:41 +00:00
osci-render is currently using JDK 15, though anything past Java 10 will probably be fine.
## Contact
James Ball, [james@ball.sh](mailto:james@ball.sh)
2020-06-23 20:06:09 +00:00
## Special Thanks
2020-10-18 20:47:41 +00:00
2020-11-08 22:27:37 +00:00
IC Hack 20 Team Members: [James Ball](https://github.com/jameshball), [William Grant](https://github.com/wdhg), [Jessica Lally](https://github.com/jessicalally), [Noor Sawhney](https://github.com/noor-gate), and [Andy Wang](https://github.com/cbeuw)