jcmellado / js-aruco

JavaScript library for Augmented Reality applications
Other
600 stars 132 forks source link

Set a matrix3d transform on an element ? #13

Closed enguerranws closed 8 years ago

enguerranws commented 8 years ago

Hi,

I have a question about ArUco js capability, as I don't find any doc on it : is it possible that ArUco get its tracker position as a 3D matrix ? I'm just trying to make, let's say, a blue square (html element) that would follow its transformation using css transform matrix3d() property.

I found in the example, a function that returns and update object rotation / scale / translation. I would basically do the same thing, updating a CSS property transform: matrix3d().

Any idea ?

jcmellado commented 8 years ago

You could build the "transformation matrix" multiplying the rotation, scale and translation matrices and use it as the input of the CSS matrix3d function.

A bit of theory: http://www.codinglabs.net/article_world_view_projection_matrix.aspx

enguerranws commented 8 years ago

Sorry, I missed this section : https://github.com/jcmellado/js-aruco#3d-pose-estimation

It can be a source to set a transform: matrix3d() / rotate3d(), canvas transform or whatever.

By the way, thanks for the job :+1: