Any way to make my orbits diagonal?

I’ve been editing the Solar System sample to simulate a system from a game I play.

It uses dummy nodes like this…

self.orbit_root_mercury = render.attachNewNode('orbit_root_mercury')

…that the planet models connect to so they can rotate around the Sun. But some of the planets in the system I’m simulating have diagonal orbits. Is there any way to adjust the position of the nodes?

Sorry if this is a dumb question, but I’m pretty new to Panda3D and I’m super close to finishing this project!

if you want to rely on Panda3D’s node structure in order to transform/tranlate your objects, you can insert empty nodes between the sun and the “diagonal” planets. the idea is to rotate one of the empty nodes in between the Sun and a planet, to say, 30 degree. so that the path can be diagonal or the axis of a planet is tilted.
but you have to add the empty node at the correct level: you have to have a clear understanding of the node structure.
without inserting empty nodes, it can also be done. but the calculation involved is not simple math. you have to do matrix rotation.

Thank you for the quick response. I’m still pretty confused, so I think I’ll have to look at the documentation and gain a better understanding of nodes.

Also, while I’ve got you here, another question: How should I go about adding orbital lines to indicate the orbit of each planet?

to show the orbits, if the orbits are dynamic, i can think of 2 ways: “polyline” and particle system.
for static orbits, just a 3D model like a “ring” can do.

You will want to adjust the hpr, the rotation, of the dummy nodes using dummy_node_path.set_hpr(0, 0, 0) (all 0 makes it just like it is now)

That kinda works, but once it makes a full rotation, it jerks down to its starting position. The start and end points are in different places.

i think you don’t understand the use of dummy/empty nodes.
have you ever used 3dsmax or similar software and make a hierachy/structure of linked objects?
the use of a dummy/empty node in this case is to tilt the rotation axis of its child node.
if you have 3dsmax, (or try Gmax or Blender etc) link visible objects and try inserting dummy nodes and make the visible objects orbit the way you want.
you have to have a context to practise, using 3dsmax(or other) is easier than using Panda3d for this purpose.

I think you’re right. I’ll fool around in Blender and see if I can figure it all out. Thanks.