www.jpct.net
jPCT-AE - a 3d engine for Android => Support => Topic started by: Irony on July 14, 2014, 01:58:30 pm
-
When I call
setScale (distanceToCamera)
on an object, shouldn't it always appear at the same size regardless of distance? It seems to not work that way, so maybe my thought is wrong?
-
What is it doing?
-
It is getting bigger when you are close. It's better than when there is no scaling done at all, but it's still very visible that the size changes.
I was thinking
twice the distance + twice the size => same apparent size,
but maybe I am thinking too simple?
-
How much does it change? Just subtle or quite visible? Your thinking seems reasonable to me, but maybe you are running into some accuracy issues with that approach.
-
It's subtle when the distance is > ~500 units
When you are very close it's very visible (multiple times the size)
As the use case is a particle effect, I guess I'll just use blitting instead of geometry.
-
It's most likely an accuracy issue then. Due to the limitations of the floating point format, neither the distance nor the scaling will be 100% correct and depending on the distance, this inaccuracies might become noticable. I don't see how to fix this...
-
Final update on this issue: it actually works exactly as it should the way I described. I was just stupid enough to not update the variable holding the distance.