Camera position not inside Skybox three.js

camera
#1

I am working on a 3D solar system project that involves a rocket rotation around a planet. I tried following this tutorial (https://www.youtube.com/watch?v=7fJgVyq0OYo) to create a skybox for my planets to exist within. Although there are no errors being displayed and I know the skybox is being created, it is nowhere near my planets and rocket and I’m unsure how to make my camera start in the center of the scene.

My code for the current project is on this jsfiddle: https://jsfiddle.net/vhb95zqf/

(The planets wont seem to load since i have the images saved on my computer and not using a source, but hopefully you can still get what I’m making from the code)

0 Likes

#2

I couldn’t get your fiddle to work. All I see is a white screen. Best not to share the entire code, but just the bit that doesn’t work.

But to answer your question of how you can change the camera location, you can set its x,y,z location like this: camera.position.set( x, y, z );

0 Likes

#3

It seems this question was already answered at stackoverflow:

@Zalgawi Please always link your identical questions at stackoverflow in your topics. Otherwise devs might do the same work twice which is a bit of unfortunate…

1 Like