Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SinCos Vectors Math
#1
Hi every one!
i have question about math
I have oculus controllers witch give me position and rotation of them, also i have surface somewhere in the space(x,y,z) The problem is that when i point my controller on that surface i wanna got the coordinates of this point in this surface and apply it to some geometry.
I found some code but something wrong with this, its didnt gave me the right result:


xr = math.cos(yaw)*math.cos(pitch)
yr = math.sin(yaw)*math.cos(pitch)
zr = math.sin(pitch)
x1 = xc+(d-zc)/zr*xr
y1 = yc+(d-zc)/zr*yr
z1 = zc+(d-zc)/zr*zr
yaw,pitch roll: controller rotation
xc,yc,zc: controller coordinates in the space
x1,y1,z1: output coordinates that i need
thanks for any help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  math.log versus math.log10 stevendaprano 10 2,519 May-23-2022, 08:59 PM
Last Post: jefsummers
  Why getting ValueError : Math domain error in trig. function, math.asin() ? jahuja73 3 3,865 Feb-24-2021, 05:09 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020