p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
There is a regression in p5.js 1.9.2 where texture coordinates don't get correctly applied to a 3D model loaded as .obj together with an image texture.
Most appropriate sub-area of p5.js?
p5.js version
1.9.2
Web browser and version
Chrome 123.0.6312.58 (Official Build) (arm64), Safari Version 16.5 (18615.2.9.11.4), Firefox 124.0.1 (64-bit)
Operating system
macOS Ventura 13.4 and Windows 10
Steps to reproduce this
There is a regression in p5.js 1.9.2 where texture coordinates don't get correctly applied to a 3D model loaded as
.obj
together with an image texture.This is likely linked to the changes made in https://github.com/processing/p5.js/pull/6710 to handle
.mtl
material library files alongside.obj
.Demo sketch
https://aijs-code-editor.web.app/editor?user=sableraph&project=Mario_3D_Model_test
Suggested Areas for Investigation:
Review how texture coordinates from
.obj
files are processed in theparseMtl()
function: https://github.com/processing/p5.js/blob/main/src/webgl/loading.js#L287Steps to reproduce
.obj
file usingloadModel()
..png
texture file usingloadImage()
.texture()
model()
in p5.js 1.9.1
in p5.js 1.9.2