processing / p5.js

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 —
http://p5js.org/
GNU Lesser General Public License v2.1
21.65k stars 3.32k forks source link

.obj models not displaying materials #7346

Open bsack23 opened 1 day ago

bsack23 commented 1 day ago

Most appropriate sub-area of p5.js?

p5.js version

1.11.0

Web browser and version

130.0.6723.70

Operating system

mac os 14.7

Steps to reproduce this

Steps:

  1. load .obj file as model
  2. in draw() call normalMaterial() for example
  3. call model(yourModel)

Snippet:


let teapot;

function preload() {
 teapot = loadModel("teapot.obj"); 
}

function setup() {
  createCanvas(400, 400, WEBGL);
}

function draw() {
  background(20);
  normalMaterial();
  scale(50);
  translate(0, 1.5, 0);
  rotateX(PI);
  model(teapot);
}
welcome[bot] commented 1 day ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!