ScratchData LogoScratchData
Back to MegaApuTurkUltra's profile

3D Rendering Framework

MEMegaApuTurkUltra•Created January 24, 2015
3D Rendering Framework
61
42
1655 views
View on Scratch

Description

Credit to @Jamonhyperturbopro and @DadOfMrLog for the tri-filler Mouse to look around, WASD to move Try in phosphorus (not a whole lot faster though): http://phosphorus.github.io/#44784782 =============================================== This is 3D rendering framework for those who are too lazy to make one themselves. Using it is simple: 1) Call Initialize Renderer (3D scale) (fov in degrees) 2) Call Start Frame (camera x) (camera y) (camera z) (camera x rotation) (camera y rotation) // rotation is buggy 3) Call Queue [list v] at (x) (y) (z) // currently model rotation is unimplemented 4) Call End Frame and Render Easy? ============================================== Bugs: - Depth sorting is not exactly working completely. Average-z doesn't account for all cases - Rendering is slow - Cam rotation is buggy - Model rotation is unimplemented ============================================== When you queue a list, the list must have triangles in the format x1 y1 z1 x2 y2 z2 x3 y3 z3 r g b xn, yn, zn are coordinates (-Inf to Inf); r, g, b is the triangle color (0 to 255). ============================================== If you want to convert Wavefront .OBJ/.MTL files to use with Scratch, you can use my program: https://drive.google.com/file/d/0B0GB5mhVFSzNOUVtSGp5TkFyek0/view?usp=sharing Use it with java -jar model2scratch.jar <obj file> [-m <mtl file>] <outputfile.txt> Then import the txt into a Scratch list ============================================== I hope this helps someone. Feel free to remix and optimize! I might be using this for an upcoming game...

Project Details

Project ID44784782
CreatedJanuary 24, 2015
Last ModifiedJanuary 27, 2015
SharedJanuary 27, 2015
Visibilityvisible
CommentsAllowed