How to rotate model?

Hello. I’m a beginner in threeJS and i have problem. I try add model with controls. I loaded model (fbx) and i added to this model controls with the help of other examples. Everything is fine but i must rotation model. Model is forward to camera and the camera follows the model so the model still moves backwards. And how rotation this model (180 degrees), i tried several ways but without effect :frowning:
This is code: https://jsfiddle.net/b12p0efu/1/

Can you also share a workable fiddle? It seems you just copy/pasted over your code. For instance the paths to your libraries and assets are obviously wrong.

Oh yea sorry: https://jsfiddle.net/0ubsrkqo/
I use cube instead model because i had a problem with load model on jsfiddle ( Access-Control-Allow-Origin). And frontside is blue (this is front of model) and i want to rotation cube (is model “Alien”) 180 deegres that model will be back to camera, and thanks to them controls will be correctly, because now model still moves backwards. Frontside of cube is green and it should be to front of camera, then everything would work properly.

Um, I’m not sure I understand your issue. Why don’t you just use an ordinary scene setup with OrbitControls like so:

https://jsfiddle.net/ht1wmLrc/1/

That’s similar to most official three.js examples.

2 Likes

I want to get effect like this: http://collinhover.github.io/kaiopua/
But my model: https://imgur.com/qI2GS2b
Camera follows the model and model moves backwards: https://imgur.com/a/t6V1oeb
So I need to rotate the model.
Your solution is ok, but the camera has to follow the model.
For example like this: https://threejs.org/examples/#webgl_loader_md2_control

@threejs

Hey, welcome threejs! You linked the example that you want to imitate, that’s great, since @Mugen87’s work is “ok” - I understand that it’s not great, not sufficient at any rate. Now you found something that is - just dig into the example code and work from there.

Did you know that all of the examples have source code available for free? Better yet, there’s a button in the bottom right corner that will take you straight to the code!

With a name like yours, I expect amazing things in your future, good luck! :wink:

3 Likes