I have been experimenting a bit with Aframe and AR.js. For augmented reality applications, a common problem is that the object placed on a marker becomes quite 'jittery' or 'jerky'. I have done some research into the problem already and it appears that a possible way to address this issue is to smooth the rotation and the position over several frames. Unfortunately, tutorials on doing so are virtually nonexistent, and I am just starting to get to grips with Html/Javascript.
Hence my question: Would you know if it is possible to have a function in an aframe entity which extracts the position and rotation, smooths them, and then passes them on to (I imagine) a child entity which uses those smoothed values for placement?
<a-entity position="0 0 0" rotation="0 0 0" >
<a-video Mysmoothingfunction src="#video" width="3.5" height="2"></a-video>
</a-entity>
I could imagine that the start might look something like this:
<script type="text/javascript">
AFRAME.registerComponent("listener", {
schema :
{
stepFactor : {
type : "number",
default : 0.05
}
},
tick: function() {
this.getProperty("position"); // something like this?
}
</script>
Would you have any idea how to tackle that issue?