Start a new topic

convert offsetX , OffsetY


I am creating a cms to work with wikitude but I don't understand what can I converter my value x and y in offsetX and offsetY that used wikitude sdk?

thank you

Hi there,

Unfortunately I do not understand what your issue exactly is. Could you please provide more details regarding your use case and what is your problem?




in cms panel or in wikitude studio i put the value for x and y like 20 or 7 or 16 but in sdk I have this value:

var overlayTwo = new AR.ImageDrawable(imgTwo, 0.5, {

   offsetX: 0.12,

   offsetY: -0.01


so I don't know to calculating the value offsetX and offsetY


Looks like there are different measuring units in Wikitude Studio and Wikitude SDK. 

Wikitude SDK uses SDU units, and Wikitude Studio uses smth. else.

To be honest I don't know how to convert one to another.

Maybe Wikitude support office knows.

thanks I hope that Wikitude support office will answer me...


Every content inside the AR View is specified in SDUs which relates to the size of an object in the real world. Since objects further away would be extremely small compared to near objects, objects are scaled up. If you don't like the rate at which objects loose size with distance from the user you can change the default settings with AR.context.scene.* (see api reference for more details).

The viewport of an HtmlDrawable is basically the size in pixel the html content has available to be rendered. See this link and  this article for more details. Hope this helps.

If the goal is to have a physical size that is similar across all screens, you can set the AR.scene.globalScale property to -1 which enables auto scaling. There is no easy way to calculate how many pixel an object with a certain size in SDUs will use. This depends on the viewing angle of the camera, the distance of the object, screen resolution, ....



ah ok I have understand but for convert to pixel in SDUs there is a formule?


As stated above, there is no easy way to calculate how many pixel an object with a certain size in SDUs will use as this depends on many factors.



Login or Signup to post a comment