# xDan

Members

180

194 Neutral

• Rank
Member
1. ## getting lat/long of a point on a double poled sphere

THANKS! That works perfectly. My original stuff was perhaps inspired by the math school of trial and error.
2. ## getting lat/long of a point on a double poled sphere

Here's some test code I'm using:   worldRadius = 10.0 for i in range(0,10): # choose a random lat/long point on sphere latitude = random.uniform(-2*pi, 2*pi) # up/down, y longitude = random.uniform(-2*pi, 2*pi) # left/right, x # Find the real world 3D position on the sphere surface real_x = worldRadius * cos(latitude) * sin(longitude) real_y = worldRadius * sin(latitude) * cos(longitude) real_z = worldRadius * cos(latitude) * cos(longitude) # Now attempt to do that backwards and get the lat/long again from this real world position. latitudeAgain = atan2(real_y, real_z) longitudeAgain = atan2(real_x, real_z) # Put all lat/longs in the range 0 - 2*PI for easy comparison latitude += 2*pi longitude += 2*pi latitudeAgain += 2*pi longitudeAgain += 2*pi latitude = fmod(latitude, 2*pi) longitude = fmod(longitude, 2*pi) latitudeAgain = fmod(latitudeAgain, 2*pi) longitudeAgain = fmod(longitudeAgain, 2*pi) # Also try to get the position once again from the newly got lat/long other_x = worldRadius * cos(latitudeAgain) * sin(longitudeAgain) other_y = worldRadius * sin(latitudeAgain) * cos(longitudeAgain) other_z = worldRadius * cos(latitudeAgain) * cos(longitudeAgain) print "Lats: ",latitude," - ",latitudeAgain," Diff: ",abs(latitude-latitudeAgain) print "Lons: ",longitude," - ",longitudeAgain," Diff: ",abs(longitude-longitudeAgain) print "Pos1: ",real_x,real_y,real_z print "Pos2: ",other_x,other_y,other_z    And the test output:   Lats: 1.57903473033 - 1.57903473033 Diff: 0.0 Lons: 5.10226596478 - 1.96067331119 Diff: 3.14159265359 Pos1: 0.0762007311343 3.80061735995 -0.0313117278778 Pos2: -0.0762007311343 -3.80061735995 0.0313117278778 Lats: 5.93480811564 - 2.79321546205 Diff: 3.14159265359 Lons: 3.39572137905 - 3.39572137905 Diff: 0.0 Pos1: -2.36299962085 3.30408958826 -9.0973998891 Pos2: 2.36299962085 -3.30408958826 9.0973998891 Lats: 2.36983896676 - 5.51143162035 Diff: 3.14159265359 Lons: 3.43495760648 - 0.293364952892 Diff: 3.14159265359 Pos1: 2.07248505761 -6.67597897677 6.86069121889 Pos2: 2.07248505761 -6.67597897677 6.86069121889 Lats: 2.71182886148 - 2.71182886148 Diff: 4.4408920985e-16 Lons: 5.72284029962 - 2.58124764603 Diff: 3.14159265359 Pos1: 4.83148051356 3.52937619571 -7.70042639429 Pos2: -4.83148051356 -3.52937619571 7.70042639429 Lats: 4.41217625779 - 1.2705836042 Diff: 3.14159265359 Lons: 3.85396423175 - 0.712371578164 Diff: 3.14159265359 Pos1: 1.9329383337 7.22964312956 2.23807587188 Pos2: 1.9329383337 7.22964312956 2.23807587188 Lats: 0.135838374462 - 3.27743102805 Diff: 3.14159265359 Lons: 1.64115450181 - 1.64115450181 Diff: 0.0 Pos1: 9.88336821577 -0.0952011605369 -0.696525460481 Pos2: -9.88336821577 0.0952011605369 0.696525460481 Lats: 5.03750570722 - 5.03750570722 Diff: 0.0 Lons: 1.46803830938 - 1.46803830938 Diff: 0.0 Pos1: 3.17734475072 -0.972036026841 0.327651707624 Pos2: 3.17734475072 -0.972036026841 0.327651707624 Lats: 0.350045505601 - 0.350045505601 Diff: 0.0 Lons: 5.436873812 - 5.436873812 Diff: 0.0 Pos1: -7.0342906832 2.27283766805 6.22558689914 Pos2: -7.0342906832 2.27283766805 6.22558689914 Lats: 0.0171541809941 - 0.0171541809941 Diff: 0.0 Lons: 1.13445981395 - 1.13445981395 Diff: 0.0 Pos1: 9.06172667879 0.0724937989497 4.22559887977 Pos2: 9.06172667879 0.0724937989497 4.22559887977 Lats: 1.69526847861 - 4.8368611322 Diff: 3.14159265359 Lons: 2.92736309538 - 6.06895574897 Diff: 3.14159265359 Pos1: -0.263938369219 -9.69580670745 1.21312953854 Pos2: -0.263938369219 -9.69580670745 1.21312953854  As you can see it works in a lot of cases, shown by the "diff" between the original and the newly gotton lat/lon being 0.0 (and Pos1 and Pos2 being equal).   Funnily, when both the lat and long are out by 180 degrees the correct position is also returned.   In the cases of failure, only one of the returned lat or long is out by 180 degrees, and Pos2 is directly opposite (negative) to Pos1. So it's really just the sign of the represented point that wrong in some cases. The actual absolute values are correct.
3. ## getting lat/long of a point on a double poled sphere

Hello, Rather than the normal way of having latitude/longitude, with a north/south pole radiating lines for longitude, and then latitude lines being parallel circles of various radii, I instead have *two* poles, so a north/south pole and an east/west pole both radiate lines. So both sets of lines being like segments of an orange, coming together at the poles. As in this rough diagram, the two poles shown as red and blue: blue pole marked x is also the x axis (+ve to the right) red pole marked y is also the y axis (+ve going upwards) +z axis is coming out of the screen towards you Now, I am managing to get a 3D point from a given lat/long, using these equations: real_x = worldRadius * cos(latitude) * sin(longitude) real_y = worldRadius * sin(latitude) * cos(longitude) real_z = worldRadius * cos(latitude) * cos(longitude) However, I also need to be able to do the reverse, from a given 3D point on the sphere, calculate the lat/long. This is giving me great trouble. I thought this might work, and it does in *some* situations, however in other cases one or the other (or even both) lat and long are out by 180 degrees (and when put into the previous equations come out to a point directly opposite to what they should be): lat = atan2(real_y, real_z) lng = atan2(real_x, real_z) Any thoughts? Math is really not my strong point.
4. ## News moderated by you - major upgrades to GameDev.net news!

I do hope the dailies will return... Don't like reddit, don't like Digg
5. ## Please beta test my game!

Little update. Now I've added grid based movement: [url="http://xzist.org/temp/puzzlegame/glyph.png"][img]http://xzist.org/temp/puzzlegame/glyph_small.png[/img][/url] Windows: [url="http://download.garnetgames.com/PuzzleMoppetTrial.exe"]PuzzleMoppetTrial.exe[/url] Linux: [url="http://download.garnetgames.com/PuzzleMoppetTrial.tar.gz"]PuzzleMoppetTrial.tar.gz[/url] The glyph thing on the ground shows the current direction... since at some angles it's not always clear which is "forwards". If anyone has an opinion on the grid based movement I'd love to hear it. Since I'm not sure whether to enable it by default or not. (it can be enabled/disabled in the options menu) Well, anyway, hopefully this is my last update (well, hopefully, you never know... I'm still not decided whether to have music or not and a few other relatively minor things)
6. ## Please beta test my game!

Thanks guys I love the Deus Ex sound track, certainly something like that. I'm looking through musicloops right now. I have been through some stuff there before, but there's such a lot, it's hard sifting through it all. @SriLumpa, eeek, thanks for reporting the website thing, I think a recent update broke something... anyway I've fixed that page and it's showing now. > The camera that repositions itself when you respawn is confusing hmm.. I could save the camera angle the player had at the time the state is saved. Or alternatively use the angle the player had before hitting undo... > I would find it good to see what I could have done to get a better rating the rating is simply the sum of all pushes/elevator moves, undos and deaths. A lower total being better. Maybe I could have the total sum displayed... and e.g. "Complete in a total of X or less for a perfect score"... (or instead of "perfect", state the amount needed to go one better rating than that the player achieved..) I agree with all your other points too, I'll look into fixing them. The ".Configuration" thing from before is still sitting on my TODO list as well... Thanks again
7. ## Please beta test my game!

Thanks :-) yeah, I've been looking for some music like that but can't seem to find any royalty free stuff that fits... all stuff I can find is a bit too "epic" if you get what I mean... I need something sedate, somewhere between ambiance and music...
8. ## Please beta test my game!

Another small update - tutorial across the first few levels - undo function! (also saves just before you fall off the world) - level ratings (can you get a "Perfect" score hmm?) - other minor things: optimisations, more character animations... [url=http://xzist.org/temp/puzzlegame/tutorial.png][img]http://xzist.org/temp/puzzlegame/tutorial_small.png[/img][/url] Windows: [url=http://download.garnetgames.com/PuzzleMoppetTrial.exe]PuzzleMoppetTrial.exe[/url] Linux: [url=http://download.garnetgames.com/PuzzleMoppetTrial.tar.gz]PuzzleMoppetTrial.tar.gz[/url] There's still some more things I'm going to add, maybe options menu and some other fixes, it's not quite finished yet...
9. ## Please beta test my game!

Hello XXChester, thanks Funny, looking at your profile we have the exact same day and date of birth... SriLumpa, thanks for the report. I don't have access to a 64 bit linux machine, and so haven't tested it so that may well be the problem. This is something I'll have to look into, I haven't before considered the differences. I'll change the .Configuration name, good point!
10. ## Please beta test my game!

[quote]the environments themselves look very dull, unlike the sound that describes them. Sure, it's colorful and pretty, but there's no motion, nothing that FEELS organic or alive[/quote] I'm not sure what a remedy for that would be. Maybe some swaying 3D grass or something? Bunnies hopping around!? [quote]there is no tutorial, I did not know how to control the game.[/quote] Hmm, I hoped it could just be intuitive and not require a tutorial, since it uses just cursor keys and mouse. But maybe the problem is a user is left wondering if there are more controls than just those they have discovered? Would a simple overlay with key controls (shown only on the first level) be enough do you think? [quote]There are no options in game for graphics, gameplay, etc[/quote] I will add graphics settings like are in the separate config app, maybe to disable ambient sfx, but what other options could there be? I'm not sure what gameplay options would entail. [quote]Do I need to see an Intro every-time I start the game?[/quote] It should save after the first level, and then when you next run it should continue from your last level. Did this not happen for you? Did it not save at all? I'm really keen to get all ideas for what this elusive "polish" entails - quite a few people have said it needs polishing... but it's often hard to find out exactly what they mean, and I don't seem to have a great grasp of it myself. I'm going to add a "push" animation when the player pushes a block, maybe that can go some way towards feedback. It's difficult to know what to do about the 360 degree movement issue. It's an odd thing having free movement in a grid based world, probably it was a mistake to attempt it. It was really born from two probably opposing things: my desire to make a full 3D third person game and my limited artistic talent/budget (since a game with repeated tiles obviously requires less artwork). You really need a free, not fixed, camera to look around the world and to see all of the puzzles (since there are overhangs), and I'm not sure grid based movement really works with a free camera.
11. ## Please beta test my game!

Just a little update: now has a basic menu system, with level select: [url="http://garnetgames.com/puzzlemoppet/screens/titlescreen.png"][img]http://garnetgames.com/puzzlemoppet/screens/titlescreen_small.png[/img][/url] [url="http://garnetgames.com/puzzlemoppet/"]http://garnetgames.com/puzzlemoppet/[/url]
12. ## Please beta test my game!

If it totally fails I'll probably rework it a bit. With the basic engine sorted making a better sequel wouldn't be too impossible either... Well, we shall see! (anyone else have an opinion? )
13. ## Please beta test my game!

Thanks for the great feedback jyk! The more the better, indeed Regarding polish, certainly most games have all fancy menus, profile systems.. I've just been taking so long over this game that I need to cut it down and try and sell *something*. Maybe I'm just a very slow coder, but I can imagine doing all those sort of things could take me several more months. I'm already at 14 months when I intended to finish the game in 6! So I may well try to sell it without doing much more on it. Perhaps I'll do a low profile launch in a few discreet parts of the internet and see what the reception is. Price, yes I must adjust that. I read somewhere someone advised setting the price quite high to start with to sell to the people that really want the game, then reducing it over time. $25 (plus extra tax in some places) definitely does seem a little high to me too though, with other (and better!) indie games around the$15-\$20 mark. I'll probably play around adjusting the price and see how it effects any sales. You can hit delete to restart the level at any time. I guess I need some control instructions somewhere. (there is a readme in the bin directory but certainly not many people will see that. Maybe I can open the readme after install, along with running the app in windowed mode...). I'll consider the trial nag message. Maybe if I just make it less frequent? Like only on the start of a new level, but not on subsequent restarts? Already it only starts to appear after a few levels have been completed, maybe I can increase that time as well. I have heard people claiming that nagging increased their sales...