RecyclingTrashCans / recycling-trashcan-armap

AR map to help finding recycling trashcan locations of CSU Fresno (powered by a companion website, ARCore Geospatial API and Terrain Anchors)
https://play.google.com/store/apps/details?id=dev.csaba.armap.recyclingtrashcans
Apache License 2.0
1 stars 2 forks source link

Make the augmented object slowly spin around vertically or bounce #16

Closed MrCsabaToth closed 1 year ago

MrCsabaToth commented 1 year ago

The down arrow is kinda symmetrical from all angels, but the map pin isn't. It could help if we'd slowly rotate the objects vertically as time passes. That would also make them stand out more from the reality background.

MrCsabaToth commented 1 year ago

About rotation:

MrCsabaToth commented 1 year ago

I think the map pin should spin around while the down arrows should bounce!

MrCsabaToth commented 1 year ago

For the rotation: https://developer.android.com/reference/android/opengl/Matrix#setRotateM(float[],%20int,%20float,%20float,%20float,%20float) creates a rotation transformation matrix. I calculate the angle from System.currentTimeMillis() in a way that 1000ms will turn the object around in one second. Then the only thing to watch out is to start with the rotation matrix and multiply that with the model view matrix got from the pose, rather than the other way around because the multiplication is not commutative. If you multiply the model view matrix by the rotation matrix than all the models will start to revolve around the viewer in a gigantic circle.