arzezniczak Posted January 15, 2019 Share Posted January 15, 2019 Hi, I've got direction vector that describes sun position in my app. I'm trying to use this vector to set proper sun rotation in Unigine (LightWorld::setWorldRotation). Is there any example how can I do this? Could you help me a little bit? I've tried to use Unigine::Math::lookAt but no luck - it doesn't work as I would expect. Link to comment
morbid Posted January 15, 2019 Share Posted January 15, 2019 Hi @arzezniczak, A similar task was solved here, please, take a look: https://developer.unigine.com/forum/topic/4530-real-sun-position/?do=findComment&comment=23617 UPD This thread also may be useful: https://developer.unigine.com/forum/topic/5201-solved-widget-update-sun-position/ Please let us know if none of them helps. Thank you. 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
arzezniczak Posted January 15, 2019 Author Share Posted January 15, 2019 Problem solved, provided links were very helpful. I've been able to calculate azimuth and elevation from my direction vector, then I'm using it to build rotation quaternion. Thank you! Link to comment
morbid Posted January 16, 2019 Share Posted January 16, 2019 You are welcome! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts