adam Posted November 20, 2016 Share Posted November 20, 2016 Can you replicate that behavior in my PG? Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 20, 2016 Author Share Posted November 20, 2016 @adam Much easier if YOU put in your function and code in my PG. I do not want to make to many PG just for testing. Quote Link to comment Share on other sites More sharing options...
adam Posted November 20, 2016 Share Posted November 20, 2016 54 minutes ago, DigiHz Data said: Much easier if YOU put in your function and code in my PG. I do not want to make to many PG just for testing. Much easier for YOU. I'm trying to work on my own project. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 20, 2016 Author Share Posted November 20, 2016 Ok @adam Sorry to have disturbd you. Thank you for your help. Anyone else that want to fix this? Quote Link to comment Share on other sites More sharing options...
jerome Posted November 21, 2016 Share Posted November 21, 2016 Actually, it's normal that the computed rotation is wrong when you align the stop with the initial world axis chosen to compute the first cross vector (please read carefully this sentence). The example Adam and I gave to you was in order to make you understand how this works. We don't do your work, we give you snippets, hints and explanations. Then please, take the time to read the code and try to understand it. I can give another hint : as you can't always compute the spot rotation from the cross product with one of the world axis (in case the spot direction is collinear with this world axis), I would - either test if the light direction is collinear with the world axis and get another one (say, Y instead of X) if this is the case before computing the first cross product - either use another approach what would be to compute the light direction from the spot orientation up to you DigiHz Data 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 21, 2016 Author Share Posted November 21, 2016 @jerome I thank you for trying to explain to me. I give it a try later on then when i have learned to be a proffesional about matrixes, upvectors, and what more that is needed. The solution is not ment for only me, but for all that is using BJS. Meanwhile.... A PG for point lights. http://www.babylonjs-playground.com/#18TRYT Quote Link to comment Share on other sites More sharing options...
Nabroski Posted November 21, 2016 Share Posted November 21, 2016 @DigiHz Data Hello jerome already shared the linkhttp://doc.babylonjs.com/classes/2.4/Vector3#static-rotationfromaxis-axis1-axis2-axis3-rarr-vector3-classes-2-4-vector3- you don't have to be good in math, just type everything that you see on wikipedia as varables down, its easy.https://en.wikipedia.org/wiki/Rotation_matrixhttp://www.babylonjs-playground.com/#1NE4XO#8 DigiHz Data 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 21, 2016 Author Share Posted November 21, 2016 Thank you @Nabroski Nabroski 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted November 21, 2016 Share Posted November 21, 2016 glad to give you hint, i make a mistake the first nummer has to be 1. i updated the playground. you still have to implement it. Good Luck DigiHz Data 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 21, 2016 Author Share Posted November 21, 2016 you mean: http://www.babylonjs-playground.com/#1NE4XO#1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted November 22, 2016 Share Posted November 22, 2016 yes its always the same, boring, we have to remix ideas to make something uniquehttp://www.babylonjs.com/cyos/#2FK9TG i think @max123 was copy pasting code from somewhere, but as i know him about 3 mouth of forum activity he will understand it himself very soon.http://www.babylonjs-playground.com/#1NE4XO#1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.