How to use webpack with three.js examples?

108 views
Skip to first unread message

Austin Haas

unread,
Jul 18, 2020, 2:20:30 PM7/18/20
to ClojureScript
Does anyone know how to include three.js examples in a cljs project using webpack?

I think I have the core three.js library included correctly, but the three.js distribution also includes additional modules in separate files that I can't seem to reference.

The three.js docs say to use: import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';

How is that done with clojurescript?

Any help or suggestions welcome.

-austin

Austin Haas

unread,
Jul 19, 2020, 12:04:26 AM7/19/20
to ClojureScript
I got it working. I'll put together a demo tomorrow. I'd explain now, but there are a few details I need to confirm.

-austin

Austin Haas

unread,
Jul 20, 2020, 12:36:54 AM7/20/20
to ClojureScript

I've created a repo that contains six different sample projects showing six different ways of incorporating three.js in a ClojureScript project.

I have tried to capture everything I know.


If you are curious about working with 3D graphics in the REPL, you can get there with about 4 steps: https://github.com/austinhaas/clojurescript-threejs-demo/tree/master/cdn-version

Feedback welcome.

-austin
Reply all
Reply to author
Forward
0 new messages