Ask coding questions

← Back to all posts
Your Three.js questions
tussiez (1641)

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?

Comments
hotnewtop
angrydoge (481)

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

angrydoge (481)

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

tussiez (1641)

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

angrydoge (481)

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

tussiez (1641)

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

Pankak (48)

how to overclock threejs

AnthonyMouse (82)

Thank you for doing this, @tussiez

Coder100 (18071)

does the three.js editor count?

make cone.

angrydoge (481)

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?

angrydoge (481)

Nvm I got it. gotta use camera.rotation lol

tussiez (1641)

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

angrydoge (481)

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

tussiez (1641)

@angrydoge module:

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

ill tell you more later, in class

tussiez (1641)

@angrydoge usage:

var controls = new PointerLockControls(camera,renderer.domElement)
tussiez (1641)

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

angrydoge (481)

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

tussiez (1641)

@angrydoge are you using a module?

<script src="app.js" type="module"></script>
tussiez (1641)

@angrydoge
import THREE with

import * as THREE from 'https://threejs.org/build/three.module.js
angrydoge (481)

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

tussiez (1641)

@angrydoge Can you give me the specific error?

angrydoge (481)

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

tussiez (1641)

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

angrydoge (481)

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

tussiez (1641)

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

angrydoge (481)

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

angrydoge (481)

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

adsarebbbad (216)

eeee i've never known how to use shadermaterial

tussiez (1641)

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

tussiez (1641)

@JBYT27 AHaAAHAHANAHAH AHAHHA

JBloves27 (1878)

...
>:)
HHAhahhhahAHAHAHahaHAHAHAHaHAHAHAhAHaHa
@tussiez

im literally spamming... ima stop