This website uses cookies.Before continuing to use our website, you agree and accept Privacy policy.Accept

Obj with texture viewer made with AI


Rotate with mouse drag, zoom with mouse wheel.

PC - Smartphone



DESCRIPTION

This time, I had AI generate a viewer that loads OBJ files with textures.

The 3D data was created using Meshy(meshy.ai), a tool that generates 3D models from prompts. You can create a certain number of models for free each month.

A textured OBJ file consists of an MTL file and an image file, typically in JPG format. In the script, you need to set the paths for both the OBJ file and the MTL file.

HOW TO MAKE/PROMPT

Created using ChatGPT. It is good to suggest three.js library path. The prompt was as follows:
Make OBJ file with texture viewer html.

#Construction
- html,js,css in 1 file
- show it on 400x400 canvas, max-width:100%
- Use Three.js, libraries are below.
https://unpkg.com/three@0.147.0/build/three.min.js
https://unpkg.com/three@0.147.0/examples/js/controls/OrbitControls.js
https://unpkg.com/three@0.147.0/examples/js/loaders/OBJLoader.js
https://unpkg.com/three@0.147.0/examples/js/loaders/MTLLoader.js

#Variable
filepath="../ai/dat/sample.obj", path to OBJ file
mtlpath="../ai/dat/model.mtl", path to MTL file

What if there is an error?




<< menu

On-site search