DEV Community

Discussion on: Help build the Metaverse by Developing VR Websites

Collapse
 
mnitish0 profile image
mnitish0

This is useful. But, I can see you have some fancy angle calculations and positioning trignometry. So, it looks like gibberish to me what is maths behind this. Do you know any good resources from where we can learn this basic maths skills before jumping into VR it will help us how to calulate these angles and use trignometry.

Thanks

Collapse
 
liorbd profile image
Lior Ben-David Codesphere Inc. • Edited

Hi mnitish0,

So the algebra/Trig here isn't actually necessary for the VR, it's more some baseline geometry that you can use to rotate a point. In general, this kind of geometry is learned in an Algebra2/Trig course. I'd recommend Kahn Academy if you don't have the chance to take it in school: khanacademy.org/math/algebra2/x2ec...

As for what's actually going on here, you can imagine that every point in a circle is given by the coordinates: x = cos(angle), y = sin(angle). If we then increment the angle(Done on line 66), we can rotate the point about a circle.

Collapse
 
mnitish0 profile image
mnitish0

Thanks a lot @liorbd ,
I will have a look and will ask if I need help. One thing in your comment that really helps is x is cos angle and y is sine. I never know that and now I am able to think why they put those values in code. Appreciate the way you comment. (Useful) 😊
Thanks