Log In  

Cart #obj_import_v01-1 | 2020-04-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

An importer for the Wavefront .OBJ format. Exports a code template with setup and a basic rendering loop. The template uses includes that are available at https://github.com/jorikemppi/pico-8-bits-and-pieces/tree/master/include. Import/export features require clipboard access, but if you just want to play around with it on a browser, it can also generate a cube.

Currently work in progress, both on the rendering engine side and the importer GUI side. Feel free to share your GUI improvement suggestions, as nearly everything in the GUI can currently be improved a lot :)

Features

  • Loads both Wavefront .OBJ files and its own internal format by pasting the object into PICO-8
  • Exports a code template with the object, plus a string with the object and material data encoded in a format you can reload in the importer
  • Translate, rotate, scale and reflect functions
  • Material editor (a material consists of diffuse and ambient values, plus a gradient used for shading)
  • Layering system (if you need to force rendering order because of painter's algorithm problems)
  • Automatic material and layer assignment to separate objects in the .OBJ file (ie. first object has material 1 and layer 1, second object has material 2 and layer 2 etc.)

To do

  • Triangulation (currently only reads the first three vertices of each face, so for now, you need to triangulate your objects before importing)
  • tline texturing support (currently only basic flat shading is supported)
  • GUI improvements (including devkit mouse support)
  • Code readability improvements

Known issues

  • GUI bug in the reflect mode. Pressing left when X axis is selected, or right when Z axis is selected, causes a crash. I'll fix this in the next update, although all it does is flip an object so I might just incorporate that functionality in the scaling mode instead.
P#75343 2020-04-25 12:38 ( Edited 2020-04-25 13:54)


[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-09-22 17:59:25 | 0.016s | Q:14