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
@oldsegotia27053 жыл бұрын
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.
@LoFiCodes3 жыл бұрын
Thanks for the info!
@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 Жыл бұрын
Doesn't work for me. What did work for me however is: controls.target.set(1, 0, 0) controls.update()
@rayandogy12782 жыл бұрын
My guy is a genius over here😍. Good job.
@VictorGabriel-ht5qp3 жыл бұрын
Thanks, that was exactly what I was looking for
@LoFiCodes3 жыл бұрын
Glad I could help! And thanks so much for the feedback!
@Martin-4D3 жыл бұрын
noice
@septaalfauzan17313 жыл бұрын
thanks this really help me to fix my program
@LoFiCodes3 жыл бұрын
So happy this helped you out! ❤️
@mirtanvirahmed38683 жыл бұрын
Thanks so much! Can you tell me how to animate the lookAt methods transition
@LoFiCodes3 жыл бұрын
Another user had the same question, so I’ve made a video here that will hopefully help you out! kzbin.info/www/bejne/rXyahIhnmsila8U
@GabrielLorscheiter2 жыл бұрын
Holly ........ I was almost having a stroke here, thank you!
@redundantlyuseful33669 ай бұрын
Gold pure gold!
@puneetmishra7701 Жыл бұрын
Thanks a lot for this, saved a lot of time 👍
@johanneswe2 жыл бұрын
ty helped me a lot
@LoFiCodes2 жыл бұрын
Happy to help out!
@dez78522 жыл бұрын
Where can I find that starter three.js template folder?
@LoFiCodes2 жыл бұрын
The starter for this project is here: github.com/davidfitzgibbon/lofiExamples/tree/main/dynamicCameras thanks for making me aware I never linked to it!
@dez78522 жыл бұрын
@@LoFiCodes awesome! Thanks mate! Keep up the good work!
@dez78522 жыл бұрын
@@LoFiCodes Ok, since I am total Newb, is there a place to find that exact app.js file or any of the templates therein?
@LoFiCodes2 жыл бұрын
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!
@TheGRoques2 жыл бұрын
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! 🙂