![]() |
|
#1
|
|||
|
|||
I am not familiar with quaternions. How do I get the angle the sensor is held at from that data?
What I am trying to do is draw a line, using the on the fly functions, that starts at my location and extends out based on the angle of the sensor in my Wanda to be used like a laser pointer. Last edited by kgarr; 09-14-2006 at 10:54 AM. |
#2
|
|||
|
|||
Is the length of the line fixed?
Either way, just translate and rotate the line to the position/rotation of the sensor. Code:
#Create line of length 1 viz.startlayer(viz.LINES) viz.vertex(0,0,0) viz.vertex(0,0,1) line = viz.endlayer() line.dynamic() . . . #Update line based on sensor data data = sensor.get() line.translate(data[:3]) line.rotatequat(data[3:7]) #If line length is dynamic, then update it line.vertex(1,0,0,length) |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|