Campbell Ritchie wrote:Why are you using string tokenizer, which has been regarded as legacy code for about 13 years?
Darryl Burke wrote:http://docs.oracle.com/javase/8/javafx/get-started-tutorial/index.html
Darryl Burke wrote:Ina (non-)word: JavaFX
Campbell Ritchie wrote:So the slopes appear 8× as steep on the smaller map? That part explains the 8 1 8. Don't know about the other things, I am afraid.
Shall try duplicating the question in the games forum.
Campbell Ritchie wrote:Please explain more about what height map is; I am not familiar with it, and maybe other poeple won't be familiar with it.
In the scale method, I can see that 250→2000 is 8, but why are you using 8 1 8?
I have got two HeightMaps. One is of size 250, the other is of size 2000.
The HeightMap with the size 2000 is stored into memory and used to detect if the player is in collision (i.e. if (player.y() < heightmap.y()) do collision stuff).
The HeightMap with the size of 250 is stored into a DisplayList and is rendered.
Before rendering (glCallList()) the 250 Heightmap, I glScalef(8, 1, 8).
It is fairly accurate. However, there seems to be a slight offset. If I move to one side of the map, I seem to collide slightly before I actually hit the land.
If I travel to the other side of the map, I seem to collide slightly after I actually hit the land.
This is a pretty big problem, because players are colliding and taking damage when graphically there is nothing to hit, and then at other times they are sinking into the map where they should be taking damage.
What is wrong? Is there anything wrong with glScalef() that I do not understand?
Campbell Ritchie wrote:I have seen one of the discussions and I did not perceive any unfriendliness myself.
Joe Thatcher wrote: . . . P.S. I tried both StackExchange and GameDev for this question. Very unfriendly & unhelpful. . . .