6 releases

0.1.5 Mar 24, 2023
0.1.4 Mar 23, 2023
0.1.2 Feb 28, 2023

#22 in #3d-rendering


Used in ftc

MIT license

120KB
2.5K SLoC

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();

Dependencies

~8.5MB
~136K SLoC