# Request for guidance:- Making 3D objects appear static on a webcam feed using arduino & an IMU:

**URL:** <https://discourse.processing.org/t/request-for-guidance-making-3d-objects-appear-static-on-a-webcam-feed-using-arduino-an-imu/10902>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [May 4, 2019, 9:34am UTC](https://discourse.processing.org/t/request-for-guidance-making-3d-objects-appear-static-on-a-webcam-feed-using-arduino-an-imu/10902 "2019-05-04T09:34:48Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![moh\_maya](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@moh\_maya](https://discourse.processing.org/u/moh_maya)\
**Post date:** [May 12, 2019, 1:34pm UTC](https://discourse.processing.org/t/request-for-guidance-making-3d-objects-appear-static-on-a-webcam-feed-using-arduino-an-imu/10902/17 "2019-05-12T13:34:51Z")

</div>

I have a lot to learn over the next few days, but will update this post. I think it’s possible to convert quaternions into Euler angles in Arduino itself, and use those.

What I’m trying to figure out now is the code necessary to rotate the objects based on the quaternion / Euler angles in processing. Basically, once I get the quaternion data into Processing, what’s the code I would need to rotate the 3D objects in the sketch. I am referring to the following threads for some insight, but would appreciate any pointers the folks here may have 🙂

> [@Using Quaternions to rotate(3D)](https://discourse.processing.org/t/using-quaternions-to-rotate-3d/7624):
>
> In my project I have used a complimentary filter to generate yaw, roll, and pitch angles. I used the rotateX, rotateY, and rotateZ functions to rotate a box in 3d. I ran into problems like gimbal lock when using this method. Now I’m using a quaternion based complimentary filter to generate quaternions that represent the orientation of the box. My question is, now that I have the quaternion representing my estimated orientation, how can I implement it to generate rotations? Are there any fun…

> [@rotateZ() not working as expected](https://discourse.processing.org/t/rotatez-not-working-as-expected/843/4):
>
> I suspect that it may be your use of the “yaw” angle that is the issue; this was the case for me with my 3-axis accelerometer. Here is a discussion about the “yaw” angle: [https://robotics.stackexchange.com/questions/4677/how-to-estimate-yaw-angle-from-tri-axis-accelerometer-and-gyroscope](https://robotics.stackexchange.com/questions/4677/how-to-estimate-yaw-angle-from-tri-axis-accelerometer-and-gyroscope) I am starting to program a quaternion class and this device is now of interest to me. According to Adafruit it will “spit out data you can use in quaternions, Euler angles or vectors.” [https://learn.adafrui…](https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/overview)

(in this one, they start with Euler angles direct from the sensor, then switch to converting the quaternions into Eulers.

---

_[View the full topic](https://discourse.processing.org/t/request-for-guidance-making-3d-objects-appear-static-on-a-webcam-feed-using-arduino-an-imu/10902)._
