Hi,
 
At the moment we're setting up a new and much better forum for you, so we can provide even better support! This is why this forum is in ‘read-only' mode for as long as we're migrating the content.
 
Please visit our brand new forum at https://support.wikitude.com to report your issues.
 
Should you wait for an urgent answer, please contact us via forum@wikitude.com (make sure to include the title of your post, so we can help you more efficiently).
 
Thank you,
The Wikitude Team
« Back

Distance Based Scaling.

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Distance Based Scaling.
Answer
10/26/16 2:33 PM

Hi there.

Trying to get my head around the distance based scaling. I uderstand if I set the height to an image drawable to 1SDU this will mean it will be displayed as if it were 1m high if it is 10m away. If the three context settings are left at defualt - ie scene.minScalingDistance at 10, scene.maxScalingDistance at 20000, and scene.scalingFactor at 0.1, then does it mean this image will scale with distance as it would in real life? So if it were 100m away it would appear the size of a 1m high object 100m away? I don't think this is what is happening though.

 

Bascially I'm trying to calculate what the real world size of an image would be, based on its distance and scaling, if its set to be 2.5 meteres high at 10m. I need to know how high it is at 100m.

 

 

 


RE: Distance Based Scaling.
Answer
10/26/16 2:39 PM as a reply to Simon Hilton.

To further this, the documentation says that if you set the variables, then the icons will scale linearly, so if min is set to 10m, max is set to 100m and scaling set to 0.1; an icon at 100m should be 10% of the size of an icon at 10 meters. This looks to be true, but an icon at 20m should be about 90% of the size, but this does not appear to be the case. It looks to be closer to half the size.

What is the scaling that is happening here?


RE: Distance Based Scaling.
Answer
10/31/16 3:17 PM as a reply to Simon Hilton.

Pleae have a look at 

AR.context functions.

AR.context.scene.globalScale
AR.context.
scene.maxScalingDistance
AR.context.scene.minScalingDistance

Best regards,
Andreas

 


RE: Distance Based Scaling.
Answer
11/2/16 9:41 AM as a reply to Andreas Fötschl.

Hi Andreas.

Those are the variables I'm setting - the doco says that they'll cause the icons to scale in a linear fashion, but as I said that doesn't look like what seems to be happening.

 

So I have:

An Icon size set to 1SDU

  1. AR.context.scene.maxScalingDistance Set to 10m
  2. AR.context.scene.minScalingDistance Set to 100m
  3. AR.context.scene.scalingFactor Set to 0.1

With this, an icon at 10m is 1SDU, and an icon at 100m is 10% of the size on screen. As the docu says that the scaling is linear, an icon at 20m I would expect to be 90% of the size of the 10m icon, but it appears to be much smaller. This is what I'm trying to understand.

 


RE: Distance Based Scaling.
Answer
11/4/16 8:31 AM as a reply to Simon Hilton.

Maybe you mized up min/max.

The following values should work as expected

AR.context.scene.minScalingDistance = 10; // which is default value anyhow
AR.context.scene.maxScalingDistance = 100;
AR.context.scene.scalingFactor = 0.1; // which is default value anyhow

Best regards,
Andreas