Skip to content

Support for .mtl Files with Textures #6924

@SableRaf

Description

@SableRaf
Contributor

Increasing access

This enhancement would make it easier for people to use pre-made 3D models within their p5.js projects. It would broaden the creative possibilities for artists and designers by enabling more detailed and textured 3D models within p5.js projects.

Most appropriate sub-area of p5.js?

  • Accessibility
    Color
    Core/Environment/Rendering
    Data
    DOM
    Events
    Image
    IO
    Math
    Typography
    Utilities
    WebGL
    Build process
    Unit testing
    Internationalization
    Friendly errors
    Other (specify if possible)

Feature enhancement details

Since version 1.9.2, p5.js supports .mtl files, but only for vertex colors (see processing/p5.js#6710).

This request aims to extend that support to include textures loaded by an .mtl file. Implementing this feature would involve creating a new data structure capable of handling both 3D models and their associated textures, potentially multiple per model.

Example sketch with a single texture: https://aijs.io/editor?user=sableraph&project=multiTextureMaterial_test

Activity

changed the title [-]Support for `.mtl` Files with Textures in p5.js[/-] [+]Support for `.mtl` Files with Textures[/+] on Mar 24, 2024
SableRaf

SableRaf commented on Mar 25, 2024

@SableRaf
ContributorAuthor

For reference, here's how Processing parses .mtl files:
processing/core/PShapeOBJ.java#L320

linked a pull request that will close this issue on May 28, 2024
diyaayay

diyaayay commented on Aug 8, 2024

@diyaayay
Contributor

Just came across this issue, and it's great that the .obj and .mtl files functionality is expanded.
Let me know if I can help in any way. Reference: #6710

SableRaf

SableRaf commented on Aug 13, 2024

@SableRaf
ContributorAuthor

Hey @diyaayay. Yes, please feel free to take this on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @SableRaf@diyaayay

      Issue actions

        Support for `.mtl` Files with Textures · Issue #6924 · processing/p5.js