Crates.io | forgedthoughts |
lib.rs | forgedthoughts |
version | 0.1.5 |
source | src |
created_at | 2023-02-22 01:15:39.288847 |
updated_at | 2023-03-24 06:25:52.330817 |
description | A 3D modeling and rendering programming language utilizing SDFs. |
homepage | |
repository | https://github.com/markusmoenig/ForgedThoughts.git |
max_upload_size | |
id | 791242 |
size | 121,196 |
For documentation and examples please visit the Website.
You can render a Forged Thoughts script in your application like this:
use forgedthoughts::prelude::*;
// Create FT
let ft = FT::new();
// Compile a script
let rc = ft.compile_code("let s = Sphere();".to_string(), "main.ft".to_string);
// Render it into a buffer
let mut buffer = ColorBuffer::new(ctx.settings.width as usize, ctx.settings.height as usize);
for i in 0..ctx.settings.renderer.iterations {
ft.render(&mut ctx, &mut buffer);
}
// Convert the buffer to Vec<u8>
let out = buffer.to_u8_vec();