New in the Forum

Hi everybody,

I am new with jMonkey. I would like to use such game engine for geographical purposes, but before that i would like to ask you, more experience people, a couple of questions, trivial ones perhaps (sorry in advance).



1- In all the videos I have seen, the perspective /camera is set as first person. Is it possible to move around our modeled world in the same way as for example Google Earth? Rotating the world, zooming in and out…using the mouse pointer.



2- (not so necessary). Does any of you have any idea if jMonkey support geographical geometries? (instead of using local coordinate systems, use geographical coordinates)



Thank you very much for your patience.



Dani

1 - Yes. Camera placement can be done pretty much the way you want. For a Google Map thing, you might want to do a Sphere and update the textures as you zoom-in, zoom-out while the textures are applied to the sphere.



2 - This is a bit over my head but I do think you could interpolate from one coordinate system to another. I’m sure there’s some “converter” code somewhere. If not, you might have to create one yourself, but I’m sure someone more knowledgeable than me can answer that more properly.

Thank you madjack for your fast answer.

For the second question it’s just a matter of math really. Google is the best teacher regarding this :stuck_out_tongue: (regarding a lot of things :stuck_out_tongue: )

look at that http://stackoverflow.com/questions/5674149/3d-coordinates-on-a-sphere-to-latitude-and-longitude

first hit for this query “longitude and latitude in 3d space”

gashsh said:
2- (not so necessary). Does any of you have any idea if jMonkey support geographical geometries? (instead of using local coordinate systems, use geographical coordinates)


If I'm not mistaken geographical coordinates are basically like x y coordinates just that the point 0,0 happens to be the geographic north pole. Even GPS coordinates use seconds to indicate where you are (Like nehon's example in google maps the numbers are quite literally just seconds for latitude and longitude or some derivative thereof).
thecyberbob said:
If I'm not mistaken geographical coordinates are basically like x y coordinates just that the point 0,0 happens to be the geographic north pole. Even GPS coordinates use seconds to indicate where you are (Like nehon's example in google maps the numbers are quite literally just seconds for latitude and longitude or some derivative thereof).

Nope, you can't simply take a XYZ coordinate and apply it to a sphere. A sphere plane has a curvature and you have to take that into account. This isn't like a flat plane. That's why you can't take a square texture and apply it to a sphere and expect the result to be undistorted. There's a thread about that texture problem that I made along with a plugin to convert a square texture on a spherical object (sort of off topic though).

FYI, North Pole is not 0, 0. It sits at 90 degrees and the second coordinate will greatly change as you move left/right. Since you're standing over the axis, going around the world is a matter of 4/5 steps. ;)

As far as GPS, iirc, coordinates are taken from the meridian 0 (which sits somewhere in England) and along that line south, from the equator. All coordinates are calculated from that point. But that's a bit hazy in my memory, I could be wrong on that.
FYI, North Pole is not 0, 0. It sits at 90 degrees and the second coordinate will greatly change as you move left/right. Since you're standing over the axis, going around the world is a matter of 4/5 steps. ;)


Ahhh shoot. I blame this on working on one coffee only right now. You're right.

Ya you're right about the not being able to apply a straight "grid" to a sphere... But to locate any point on a globe that's kinda how it's done regardless. But ya. For in a game it'd be much more complicated than that. Also unless your Map is say several dozen square kilometers you wouldn't have that much deviation if you used seconds as your grid coordinate system across the top and bottom really. I mean yes it'd be off. But probably not so much as you'd notice unless you went reaaaaaaaaaaaaally far.

I agree that scale (in a large sense) could remove the need for “precision”. Let’s call it that. If, as you propose, you have a 5km x 5km grid, deformation is trivial.



But here the OP is saying he’s not working on a game, thus, I imagine it has to do with applying deformation since there was a comparison to Google Earth. I imagine the scope of his endeavor to have a similar outlook/utilization. He also mentioned coordinate system translation, so… :slight_smile:

madjack said:
I agree that scale (in a large sense) could remove the need for "precision". Let's call it that. If, as you propose, you have a 5km x 5km grid, deformation is trivial.

But here the OP is saying he's not working on a game, thus, I imagine it has to do with applying deformation since there was a comparison to Google Earth. I imagine the scope of his endeavor to have a similar outlook/utilization. He also mentioned coordinate system translation, so... :)


Alright alright I concede defeat. SHEESH! :P