mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Attempts to maintain the balance between correctness and appearance.
Added mip mapping due to the increase in distance.
This commit is contained in:
parent
3c6eed8f39
commit
b2e3a1d486
|
@ -159,9 +159,9 @@ class Applet(pyglet.window.Window):
|
||||||
elif symbol == key.NUM_DIVIDE:
|
elif symbol == key.NUM_DIVIDE:
|
||||||
self.speed -= 10
|
self.speed -= 10
|
||||||
elif symbol == key.PAGEUP:
|
elif symbol == key.PAGEUP:
|
||||||
self.speed += 100
|
self.speed += 1000
|
||||||
elif symbol == key.PAGEDOWN:
|
elif symbol == key.PAGEDOWN:
|
||||||
self.speed -= 100
|
self.speed -= 1000
|
||||||
elif symbol == key.I:
|
elif symbol == key.I:
|
||||||
self.info = not self.info
|
self.info = not self.info
|
||||||
elif symbol == key.D:
|
elif symbol == key.D:
|
||||||
|
|
|
@ -213,7 +213,7 @@ def load_texture(file):
|
||||||
filter = GL_NEAREST if badcard else GL_LINEAR
|
filter = GL_NEAREST if badcard else GL_LINEAR
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter)
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter)
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter)
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter)
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, mode, width, height, 0, mode2, GL_UNSIGNED_BYTE, texture)
|
gluBuild2DMipmaps(GL_TEXTURE_2D, len(raw.format), width, height, mode2, GL_UNSIGNED_BYTE, texture)
|
||||||
|
|
||||||
cache[file] = id
|
cache[file] = id
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
|
"au": 10000,
|
||||||
"planets": {
|
"planets": {
|
||||||
"earth": {
|
"earth": {
|
||||||
"texture": ["earth.jpg", "earth_medium.jpg", "earth_small.jpg", [0, 0.28, 1, 1]],
|
"texture": ["earth.jpg", "earth_medium.jpg", "earth_small.jpg", [0, 0.28, 1, 1]],
|
||||||
"radius": 100,
|
"radius": 100,
|
||||||
"z": "2 * AU",
|
"z": "AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 23.4,
|
"yaw": 23.4,
|
||||||
"roll": -90,
|
"roll": -90,
|
||||||
|
@ -15,8 +16,8 @@
|
||||||
"satellites": {
|
"satellites": {
|
||||||
"moon": {
|
"moon": {
|
||||||
"texture": ["moon.jpg", "moon_medium.jpg", "moon_small.jpg", [0.53, 0.53, 0.53, 1]],
|
"texture": ["moon.jpg", "moon_medium.jpg", "moon_small.jpg", [0.53, 0.53, 0.53, 1]],
|
||||||
"radius": 25,
|
"radius": 27.25,
|
||||||
"distance": 200,
|
"distance": 603.357,
|
||||||
"orbit_speed": 1,
|
"orbit_speed": 1,
|
||||||
"eccentricity": 0.0549,
|
"eccentricity": 0.0549,
|
||||||
"inclination": 5.145,
|
"inclination": 5.145,
|
||||||
|
@ -25,41 +26,42 @@
|
||||||
},
|
},
|
||||||
"iss": {
|
"iss": {
|
||||||
"model": "satellites/iss.obj",
|
"model": "satellites/iss.obj",
|
||||||
|
"inclination": 51.65,
|
||||||
"distance": 110,
|
"distance": 110,
|
||||||
"scale": 10
|
"scale": 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mars": {
|
"mars": {
|
||||||
"texture": ["mars.jpg", "mars_small.jpg", "mars_medium.jpg", [0.85, 0.47, 0.2, 1]],
|
"texture": ["mars.jpg", "mars_small.jpg", "mars_medium.jpg", [0.85, 0.47, 0.2, 1]],
|
||||||
"radius": 80,
|
"radius": 53.3,
|
||||||
"z": "4 * AU",
|
"z": "1.524 * AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 25.19
|
"yaw": 25.19
|
||||||
},
|
},
|
||||||
"jupiter": {
|
"jupiter": {
|
||||||
"texture": ["jupiter.jpg", "jupiter_medium.jpg", "jupiter_small.jpg", [0.65, 0.36, 0.19, 1]],
|
"texture": ["jupiter.jpg", "jupiter_medium.jpg", "jupiter_small.jpg", [0.65, 0.36, 0.19, 1]],
|
||||||
"radius": 150,
|
"radius": 1120,
|
||||||
"z": "6 * AU",
|
"z": "5.2 * AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 3.13
|
"yaw": 3.13
|
||||||
},
|
},
|
||||||
"saturn": {
|
"saturn": {
|
||||||
"texture": ["saturn.jpg", "saturn_medium.jpg", "saturn_small.jpg", [0.9, 0.8, 0.64, 1]],
|
"texture": ["saturn.jpg", "saturn_medium.jpg", "saturn_small.jpg", [0.9, 0.8, 0.64, 1]],
|
||||||
"radius": 140,
|
"radius": 945,
|
||||||
"z": "8 * AU",
|
"z": "9.58 * AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 26.73,
|
"yaw": 26.73,
|
||||||
"ring": {
|
"ring": {
|
||||||
"texture": "ring_saturn.png",
|
"texture": "ring_saturn.png",
|
||||||
"distance": 200,
|
"distance": 1169,
|
||||||
"size": 150
|
"size": 2247
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uranus": {
|
"uranus": {
|
||||||
"texture": ["uranus.jpg", [0, 0.53, 0.84, 1]],
|
"texture": ["uranus.jpg", [0, 0.53, 0.84, 1]],
|
||||||
"radius": 130,
|
"radius": 400,
|
||||||
"z": "10 * AU",
|
"z": "19.23 * AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 97.77,
|
"yaw": 97.77,
|
||||||
"ring": {
|
"ring": {
|
||||||
|
@ -67,14 +69,14 @@
|
||||||
"pitch": 0,
|
"pitch": 0,
|
||||||
"yaw": 0,
|
"yaw": 0,
|
||||||
"roll": 90,
|
"roll": 90,
|
||||||
"distance": 200,
|
"distance": 421,
|
||||||
"size": 100
|
"size": 781
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"neptune": {
|
"neptune": {
|
||||||
"texture": ["neptune.jpg", [0.31, 0.49, 0.59, 1]],
|
"texture": ["neptune.jpg", [0.31, 0.49, 0.59, 1]],
|
||||||
"radius": 120,
|
"radius": 388,
|
||||||
"z": "12 * AU",
|
"z": "30.5 * AU",
|
||||||
"pitch": -90,
|
"pitch": -90,
|
||||||
"yaw": 28.32
|
"yaw": 28.32
|
||||||
},
|
},
|
||||||
|
@ -91,7 +93,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"start": {
|
"start": {
|
||||||
"z": "2 * AU - 400",
|
"z": "AU - 400",
|
||||||
"yaw": 180
|
"yaw": 180
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -61,7 +61,7 @@ def load_world(file):
|
||||||
root = json.load(f, object_pairs_hook=OrderedDict)
|
root = json.load(f, object_pairs_hook=OrderedDict)
|
||||||
|
|
||||||
world = World()
|
world = World()
|
||||||
e = lambda x: eval(str(x), {'__builtins__': None}, {'AU': AU})
|
e = lambda x: eval(str(x), {'__builtins__': None}, {'AU': root.get('au', 2000)})
|
||||||
|
|
||||||
if 'start' in root:
|
if 'start' in root:
|
||||||
info = root['start']
|
info = root['start']
|
||||||
|
|
Loading…
Reference in a new issue