Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,6 +42,8 @@ def add_planet(name, radius, mass, distance_from_sun):
|
|
42 |
duration=2
|
43 |
end_frame = int(duration * 10)
|
44 |
planet.rotation_mode = 'XYZ'
|
|
|
|
|
45 |
for frame in range(start_frame, end_frame + 1):
|
46 |
##angle = (frame / end_frame) * 2 * math.pi
|
47 |
##x = radius * math.cos(angle)
|
@@ -51,8 +53,7 @@ def add_planet(name, radius, mass, distance_from_sun):
|
|
51 |
##planet.keyframe_insert(data_path="location", index=-1, frame=frame)
|
52 |
angle = math.radians(frame * 18)
|
53 |
planet.rotation_euler = (0, 0, angle)
|
54 |
-
|
55 |
-
planet.keyframe_insert(data_path="rotation_euler", index=2, frame=end_frame)
|
56 |
##return planet
|
57 |
|
58 |
def create_planet_flyby_animation(planet, radius, duration):
|
|
|
42 |
duration=2
|
43 |
end_frame = int(duration * 10)
|
44 |
planet.rotation_mode = 'XYZ'
|
45 |
+
planet.keyframe_insert(data_path="rotation_euler", index=2, frame=start_frame)
|
46 |
+
|
47 |
for frame in range(start_frame, end_frame + 1):
|
48 |
##angle = (frame / end_frame) * 2 * math.pi
|
49 |
##x = radius * math.cos(angle)
|
|
|
53 |
##planet.keyframe_insert(data_path="location", index=-1, frame=frame)
|
54 |
angle = math.radians(frame * 18)
|
55 |
planet.rotation_euler = (0, 0, angle)
|
56 |
+
planet.keyframe_insert(data_path="rotation_euler", index=-1, frame=frame)
|
|
|
57 |
##return planet
|
58 |
|
59 |
def create_planet_flyby_animation(planet, radius, duration):
|