Rendering an .OBJ as a 3D interactive display

  • #1
DaveC426913
Gold Member
23,203
6,886
TL;DR Summary
What tools do I use to make one of those renderings (in a browser) that you can rotate with your mouse? I have the .OBJ and Blender 10.
Welp. I've been given a challenge to help out with a project. I have no budget, no knowledge-holders and not much knowledge, but I'll see how far I can get.

I am about to receive an .OBJ file of a critter. I have some experience in Blender, building and shaping and stuff (not a super complex, fluid object like a creature but see my creation, attached - designed, built and 3D printed by me, which I am quite proud of), but I have yet to crack the seal on actually applying colour or even rendering in colour (as opposed to the default uniform grey). So that'll be step one.

The next step is to output the critter in a format that is usable by whatever applet (do they still have Java applets?) so that it can be rendered (presumably in a browser) so that a user can rotate it in 3D with their mouse. I'm nore sure how the kids do that these days.
 

Attachments

  • scimitar1.jpg
    scimitar1.jpg
    32.8 KB · Views: 1
Computer science news on Phys.org
  • #2
DaveC426913 said:
TL;DR Summary: What tools do I use to make one of those renderings (in a browser) that you can rotate with your mouse? I have the .OBJ and Blender 10.
The most widely used is Three.js which has an addon which can load .obj files directly: https://threejs.org/docs/#examples/en/loaders/OBJLoader.

DaveC426913 said:
(do they still have Java applets?)
No.

DaveC426913 said:
I'm nore sure how the kids do that these days.
Three.js.
 
  • Informative
  • Like
Likes jack action, DaveC426913 and BvU
  • #3
OK. I've downloaded and unpacked three.js.

It explicitly assumes I'm either running a build tool, or using a local server with a CDN and import maps.

I really just want a proof of concept. If I can see the file using an index.html, a link to the .js files and a reference to the .obj file I'll be happy. But I don't think that's going to happen.

Ugh. Seriously don't want to spin up a whole dev environment. This is why left front-end dev in the first place. It's all environment and config stuff, and no coding.

I stole this code from stack overflow as a way to start, but of course it dies on line 1 of the js code because OBJLoader doesn't exist.

[ unable to post CODE block ]

Do I need to also run this in a local server like WAMP or something?
 

Similar threads

Replies
4
Views
3K
Replies
34
Views
53K
Replies
1
Views
2K
Replies
7
Views
3K
Replies
9
Views
3K
Back
Top