ThreeJS - camera.lookAt VS OrbitControls

  Рет қаралды 13,022

LoFi

LoFi

Күн бұрын

I was having trouble this week trying to get my camera looking in a particular direction. The camera.lookAt function wouldnt work. It turned out updating orbit controls was getting in my way!

Пікірлер: 24
@oldsegotia2705
@oldsegotia2705 3 жыл бұрын
Just to add to this. You only need controls.update if controls.enableDamping or if controls.autoRotate = true. If they are set to true and you want to use the lookAt method like in this example, just put it in the animate function after controls.update.
@LoFiCodes
@LoFiCodes 3 жыл бұрын
Thanks for the info!
@truth.detective
@truth.detective Жыл бұрын
Two days i spent figuring out why changing of camera focus doesn't do a thing! 😅 Well I had a feeling that it does just for a frame. Thank you for the tip. Gonna try it out when I get to my laptop.
@displee6545
@displee6545 Жыл бұрын
Doesn't work for me. What did work for me however is: controls.target.set(1, 0, 0) controls.update()
@rayandogy1278
@rayandogy1278 2 жыл бұрын
My guy is a genius over here😍. Good job.
@VictorGabriel-ht5qp
@VictorGabriel-ht5qp 3 жыл бұрын
Thanks, that was exactly what I was looking for
@LoFiCodes
@LoFiCodes 3 жыл бұрын
Glad I could help! And thanks so much for the feedback!
@Martin-4D
@Martin-4D 3 жыл бұрын
noice
@septaalfauzan1731
@septaalfauzan1731 3 жыл бұрын
thanks this really help me to fix my program
@LoFiCodes
@LoFiCodes 3 жыл бұрын
So happy this helped you out! ❤️
@mirtanvirahmed3868
@mirtanvirahmed3868 3 жыл бұрын
Thanks so much! Can you tell me how to animate the lookAt methods transition
@LoFiCodes
@LoFiCodes 3 жыл бұрын
Another user had the same question, so I’ve made a video here that will hopefully help you out! kzbin.info/www/bejne/rXyahIhnmsila8U
@GabrielLorscheiter
@GabrielLorscheiter 2 жыл бұрын
Holly ........ I was almost having a stroke here, thank you!
@redundantlyuseful3366
@redundantlyuseful3366 9 ай бұрын
Gold pure gold!
@puneetmishra7701
@puneetmishra7701 Жыл бұрын
Thanks a lot for this, saved a lot of time 👍
@johanneswe
@johanneswe 2 жыл бұрын
ty helped me a lot
@LoFiCodes
@LoFiCodes 2 жыл бұрын
Happy to help out!
@dez7852
@dez7852 2 жыл бұрын
Where can I find that starter three.js template folder?
@LoFiCodes
@LoFiCodes 2 жыл бұрын
The starter for this project is here: github.com/davidfitzgibbon/lofiExamples/tree/main/dynamicCameras thanks for making me aware I never linked to it!
@dez7852
@dez7852 2 жыл бұрын
@@LoFiCodes awesome! Thanks mate! Keep up the good work!
@dez7852
@dez7852 2 жыл бұрын
@@LoFiCodes Ok, since I am total Newb, is there a place to find that exact app.js file or any of the templates therein?
@LoFiCodes
@LoFiCodes 2 жыл бұрын
Oh no, it's my fault! I actually thought you were talking about another video! My fault for trying to go too fast. I have a starter template for ThreeJS here: github.com/davidfitzgibbon/starterThree it's more refined even than when I made that video, so you might notice differences. In fact, I've spent the last few weeks working on a bootstrapping framework called Threeasy. You can check out a video about it here: kzbin.info/www/bejne/onfGoHWjfLCSb6s Does that answer your question? Apologies again for my mistake!
@TheGRoques
@TheGRoques 2 жыл бұрын
Wow! This helped me a lot. I wasted a day or two being completely perplexed, but now I relaize OrbitControl's update method was overriding what I was trying to do to the camera. Thanks! 🙂
@LoFiCodes
@LoFiCodes 2 жыл бұрын
Glad it helped!
Hands-on ThreeJS - Camera paths
5:54
Nik Lever
Рет қаралды 10 М.
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2,1 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 1,6 МЛН
Please Help This Poor Boy 🙏
00:40
Alan Chikin Chow
Рет қаралды 23 МЛН
Simple Third Person Camera (using Three.js/JavaScript)
13:00
SimonDev
Рет қаралды 65 М.
ThreeJS - Control Multiple Objects
24:38
LoFi
Рет қаралды 4,4 М.
Three.js Optimization - Best Practices and Techniques
17:47
Valentin's coding book
Рет қаралды 37 М.
ThreeJS - Dynamic Camera
18:48
LoFi
Рет қаралды 9 М.
Three.JS Orbit Controls: Zoom, Pan, Rotate [Checkers 1]
21:33
SyntaxByte
Рет қаралды 28 М.
How Rendering Graphics Works in Games!
6:25
TheHappieCat
Рет қаралды 750 М.
Three.js Realistic Material Reflection Tutorial in 8 Minutes
8:54
Three.js Lighting Tutorial with Examples
5:24
Suboptimal Engineer
Рет қаралды 16 М.
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2,1 МЛН