xxxxxxxxxx
25
let myModel;
function preload() {
// Load the 3D model
myModel = loadModel('untitled5.obj', true); // Enable normalize for consistent scaling
}
function setup() {
createCanvas(600, 600, WEBGL); // Use WEBGL for 3D rendering
}
function draw() {
background(200);
// Add some basic interactivity
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
// Display the model
scale(2); // Adjust scale as needed
noStroke(); // Remove edges for a smoother look
normalMaterial(); // Apply a default material for shading
model(myModel);
}