← Back to Community
Your Three.js questions
Profile icon
tussiez

I've been looking through Repl.it Ask, and I see a lot of unanswered or incorrectly answered questions relating to Three.js.
Does anyone have any questions about this library?

Voters
Profile icon
Unclyscam123
Profile icon
Baconman321
Profile icon
AnthonyMouse
Profile icon
programmeruser
Profile icon
angrydoge
Profile icon
tussiez
Comments
hotnewtop
Profile icon
nhowe

I'd love to see a full example of using Three.js with modules. It's unclear to me where the Three.js modules are supposed to be included from -- am I supposed to include the entire build in my repl somehow? That seems cumbersome.

Profile icon
tussiez

@nhowe You don’t need to include the entire library. For example, OrbitControls is found at https://threejs.org/examples/jsm/controls/OrbitControls.js

Profile icon
angrydoge

If youre not working on SortaCraft can you come on The void and help me set up the TV?.

Profile icon
angrydoge

um @tussiez can you?

Profile icon
tussiez

@angrydoge Doing homework ATm

Profile icon
angrydoge

K tell me when u can. @tussiez

Profile icon
tussiez
Profile icon
angrydoge

Lol can you come on now its been an hour. @tussiez

Profile icon
tussiez

@angrydoge Sorry.. it's called an "async" day.

Profile icon
angrydoge

oof. Asynchronous days are sorta fun, but you cant code lol @tussiez

Profile icon
tussiez
Profile icon
angrydoge

Can u today? :| @tussiez

Profile icon
tussiez

@angrydoge Have to attend a meeting after school, I'll let you know when. Enjoy your Friday!

Profile icon
angrydoge

kk u too :D @tussiez

Profile icon
Pankak

how to overclock threejs

Profile icon
AnthonyMouse

Thank you for doing this, @tussiez

Profile icon
Coder100

does the three.js editor count?

make cone.

Profile icon
tussiez

@Coder100 ConeGeometry IIRC

Profile icon
angrydoge

I have a first person rig rn.

It can move around, but cant look left or right.

How would I adjust the camera.position for that?

Profile icon
angrydoge

Nvm I got it. gotta use camera.rotation lol

Profile icon
tussiez

@angrydoge Are you using PointerLockControls? This makes first person controls/look SUPER easy.

Profile icon
angrydoge

oooo im not but lemme try @tussiez
is that a function?

Profile icon
tussiez

@angrydoge module:

import {PointerLockControls} from 'https://threejs.org/examples/jsm/PointerLockControls.js'

ill tell you more later, in class

Profile icon
tussiez

@tussiez & How to use it

Profile icon
tussiez

@angrydoge usage:

var controls = new PointerLockControls(camera,renderer.domElement)
Profile icon
angrydoge
Profile icon
angrydoge

I got error :(( oof. @tussiez

Profile icon
tussiez

@angrydoge Rip, what was it?
If it says "PointerLockControls: unable to lock/not supported", that's normal

Profile icon
tussiez

imma make tutorial @angrydoge

Profile icon
angrydoge

It had an import error saying you cant import outside of import or sumth @tussiez

Profile icon
tussiez

@angrydoge are you using a module?

<script src="app.js" type="module"></script>
Profile icon
tussiez

@angrydoge
import THREE with

import * as THREE from 'https://threejs.org/build/three.module.js
Profile icon
angrydoge

I mean I used the import thing u said to do @tussiez

Profile icon
tussiez

@angrydoge Can you give me the specific error?

Profile icon
angrydoge

SyntaxError: Cannot use import statement outside a module
at /script.js:1:1 @tussiez

Profile icon
tussiez

@angrydoge you need to link you script as a module
<script type="module">

Profile icon
tussiez
Profile icon
angrydoge

I wasnt using <script> i was using import im js using the code you sent earlier @tussiez

Profile icon
tussiez

@angrydoge Can you share your void Repl with me? I have a few minutes of free time.

Profile icon
angrydoge

Kk im workin on it @tussiez

Profile icon
tussiez
Profile icon
angrydoge

I invited you go find it in ur multiplayer repls @tussiez

Profile icon
tussiez

doing later [email protected]

Profile icon
angrydoge

Ive never known how the heck to make a scene. Every time theres some sort of error.

Profile icon
adsarebbbad

const scene = new THREE.Scene() <=== how about this @angrydoge

Profile icon
angrydoge
Profile icon
tussiez
Profile icon
angrydoge
Profile icon
adsarebbbad

eeee i've never known how to use shadermaterial

Profile icon
tussiez

@adsarebbbad Yay! Tutorial time!
I'll write one later.. i'm in school XD

Profile icon
JBloves27

hahahaha @tussiez

Profile icon
tussiez

@JBYT27 AHaAAHAHANAHAH AHAHHA

Profile icon
JBloves27

...
>:)
HHAhahhhahAHAHAHahaHAHAHAHaHAHAHAhAHaHa
@tussiez

im literally spamming... ima stop

Profile icon
adsarebbbad
Profile icon
JBloves27

haha, cya @adsarebbbad

Profile icon
JBloves27

stupid me: what is three.js? XD

Profile icon
tussiez
Profile icon
JBloves27

lol, ikr? im rly stupid in the area of web. However, trying to learn web XD @tussiez

Profile icon
adsarebbbad
Profile icon
JBloves27
Profile icon
tussiez
Profile icon
adsarebbbad

what's with the XDs @JBYT27

Profile icon
JBloves27

idk. maybe I should try doing xD? @adsarebbbad

Profile icon
tussiez

This is super off topic Xd @adsarebbbad

Profile icon
tussiez

@JBYT27 _(0.0)_/Idk

Profile icon
JBloves27

lel, ikr @tussiez

Profile icon
JBloves27

hahahaha @tussiez

Profile icon
tussiez