10-19-2022, 12:23 AM
(10-18-2022, 10:47 PM)james2464 Wrote: [quote pid="8096" dateline="1666124430"]
Works great! Thanks for giving this a go. I'm still trying to figure it out but I think I'll get there. Right now I'm trying to get the full 360 degree rotation but I did get the reflection to work at least. Cheers!
[/quote]
It was giving me a screwy result until I realized that the orthogonal vector had to be a unit length before applying the dot product calculation. After that the diagonal of the parallelogram was the proper length for obtaining the reflecting vector.
I was pleasantly surprised that dot product handles either side of the reflecting wall perfectly and...
it doesn't matter which orthogonal is constructed...
both...
orth.x = -wall.y: orth.y = wall.x
and...
orth.x = wall.y: orth.y = -wall.x
work exactly the same. I originally thought there would be a difference. I might be starting to get the hang of this stuff.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: