Gerlina Steffen
2014-07-26 17:35:39 UTC
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello.</div>
<div>I'm new to OpenSG and have a question since i'm working on the whole day without success :). I hope this is the right place to ask such a question, if not, please forgive me. I have searched a lot for for this but haven't found anything helping so far.</div>
<div><br/>
For my project I have the following things:</div>
<div>- A OSG::Quaternion which represents an input device (something similar to a Razer hydra)<br/>
- A OSG::Line to calculate intersections</div>
<div> </div>
<div>With the device I want to point onto things (something like a laser pointer) in my scene. Unfortunately, to calculate intersections OpenSG uses the OSG::Line class, so I need to translate my Quaternion into a Line. The position is no problem, but with the calculation from a rotation as a Quaternion to a direction as Vec3f I have problems.</div>
<div>To get my direction vector I use "device.getEulerAngleRad(ray_direction)".</div>
<div>However the angles don't seem to be right. When I move my device left, my line goes "up left" for example. Somehow the transformation doesn't work completly. What am i missing? Or is there maybe even a better way to calculate intersections with my pointing device?</div>
<div> </div>
<div>Thank you.</div>
<div>Greetings,</div>
<div>Gekko</div>
</div></div></body></html>
<div>Hello.</div>
<div>I'm new to OpenSG and have a question since i'm working on the whole day without success :). I hope this is the right place to ask such a question, if not, please forgive me. I have searched a lot for for this but haven't found anything helping so far.</div>
<div><br/>
For my project I have the following things:</div>
<div>- A OSG::Quaternion which represents an input device (something similar to a Razer hydra)<br/>
- A OSG::Line to calculate intersections</div>
<div> </div>
<div>With the device I want to point onto things (something like a laser pointer) in my scene. Unfortunately, to calculate intersections OpenSG uses the OSG::Line class, so I need to translate my Quaternion into a Line. The position is no problem, but with the calculation from a rotation as a Quaternion to a direction as Vec3f I have problems.</div>
<div>To get my direction vector I use "device.getEulerAngleRad(ray_direction)".</div>
<div>However the angles don't seem to be right. When I move my device left, my line goes "up left" for example. Somehow the transformation doesn't work completly. What am i missing? Or is there maybe even a better way to calculate intersections with my pointing device?</div>
<div> </div>
<div>Thank you.</div>
<div>Greetings,</div>
<div>Gekko</div>
</div></div></body></html>