I’m in the process of trying to design a 2D game and most of it will be using dynamically generated pngs. The one part that would probably be better not as a png would be the sunrise and sunset.

I have lots of programming experience but I do not have any real game development experience. I’m wondering what would be the best way to create a sunrise and sunset in panda3d. I will be using a few NodePath’s for parts of things. Rotating stars and sun on one. Then probably a NodePath which I will use to fade out the stars as the sun comes up and they sky becomes blue. And then I’d want one where the sunrise and sunset are on.

I was thinking of designing some 2D EggData and creating them live in python so I can add a little randomness from day to day so that they are not always the same. I’ve got a very basic example set up with 6 vertex points (bottom center, bottom left, top left, top center, top right, bottom right, and bottom center to close the shape. The point values mentioned may not work as I’ve switched my version of pixel2d so that 0, 0 is bottom left and positive numbers go up and right (because I don’t like working in negative numbers).

``````data = EggData()

vertex_pool = EggVertexPool('Sunrise')

polygon = EggPolygon()

vertex = EggVertex()
vertex.setPos(Point3D(0, 0, 0))
vertex.setColor((0.984375, 0.890625, 0.4765625, 1))

vertex = EggVertex()
vertex.setPos(Point3D(-1200, 0, 0))
vertex.setColor((0.984375, 0.890625, 0.4765625, 1))

vertex = EggVertex()
vertex.setPos(Point3D(-1200, 0, 1200))
vertex.setColor((0.0, 0.0, 0.99609375, 1))

vertex = EggVertex()
vertex.setPos(Point3D(1200, 0, 1200))
vertex.setColor((0.0, 0.0, 0.99609375, 1))

vertex = EggVertex()
vertex.setPos(Point3D(1200, 0, 0))
vertex.setColor((0.984375, 0.890625, 0.4765625, 1))