rather than join the people spamming the boards, i’d ask a related question here.
I am now having huge trouble getting the planet to orbit a point. rotating around its own axis is no problem using hprinterval, but when i try do the same thing to its parent node nothing happens.
now i have managed to get the planets moon rotating around the planet so cannot for the life of me figure out why the planet refuses to budge.
to help me understand what is going on i have highlited each node in a color and then lablled it in space.

on the left you can see the multiple yellow boxes each represent the self.planet_np (2nd level node path) of multiple other planets as well.
red is the top level move_np mesh
and there is also a green square which somehow represents the actual mesh is if fact sitting right under the yellow node path representational mesh at 0,0,0
now it should be simple to rotate teh mesh around the green or yellow nodes. but it just doesnt happen.
def make_planet(self):
self.move_np = render.attachNewNode('dummy_node') # empty node
self.planet_np = render.attachNewNode('planet_node'+str(self.ID))
self.planet_mesh = loader.loadModel('smiley')
self.texture = loader.loadTexture(self.p_tex)
#self.planet_mesh.reparentTo(render)
self.planet_mesh.setTexture(self.texture,1)
self.texture.setMagfilter(Texture.FTLinear)
self.texture.setMinfilter(Texture.FTLinear)
#self.planet_mesh.setHpr(0,45,0)
self.planet_mesh.setScale(self.size)
#self.planet_mesh.setEffect(CompassEffect.make(render, CompassEffect.PScale))
#self.planet_mesh.flattenLight()
self.planet_mesh.reparentTo(self.planet_np)
self.planet_np.reparentTo(self.move_np)
self.move_np.setPos(self.pos[0],self.pos[1],self.pos[2]+random.randint(2,8))
#self.planet_mesh.setPos(0,0,0)
self.square_select(self.move_np,True) #red
self.square_select(self.planet_np,True,(1,1,0.1,1)) # yellow
self.square_select(self.planet_mesh,False,(0.1,0.8,0.1,1)) #green
self.planet_mesh.setHpr(0,30,0)
rotate = self.planet_mesh.hprInterval(5, Vec3(359,30,0)) # rotate on own axis
rotate2 = self.planet_np.hprInterval(30, Vec3(360,0,0)) # rotate around another axis
parallel2 = Parallel(rotate,rotate2)
parallel2.loop()
return self.planet_np
i have got the moon to rotate around the parent planet using the below code so i do not understand why on earth the planet wont rotate around either of it’s parent nodes
def make_moon(self,pos):
self.moon_move_np = render.attachNewNode('moon_dummy_node')
self.moon_np = render.attachNewNode('moon_node'+str(self.ID))
self.moon_mesh = loader.loadModel('smiley')
self.texture = loader.loadTexture(self.m_tex)
self.moon_mesh.setTexture(self.texture,1)
self.texture.setMagfilter(Texture.FTLinear)
self.texture.setMinfilter(Texture.FTLinear)
#self.moon_mesh.reparentTo(render)
self.moon_mesh.setScale(0.5)
self.moon_mesh.flattenLight()
self.moon_mesh.reparentTo(self.moon_np)
self.moon_np.reparentTo(self.moon_move_np)
self.moon_move_np.reparentTo(self.move_np)
self.moon_np.setPos(0,self.size*3,0)
#self.square_select(self.moon_np,False,(0.4,0.4,1,1))
#self.square_select(self.moon_mesh,False,(0.1,0.1,0.8,1))
#self.square_select(self.moon_move_np,False,(0.9,0.9,0.9,1))
orbit = self.moon_move_np.hprInterval(self.moon_speed, Vec3(359,0,0))
parallel = Parallel(orbit)
parallel.loop()
NOT solver. i though it was but the moon orbits gone whakky. back to drawing board. how can such a simple thing be so deceptively tricky?
edit — changing
self.move_np.setPos(self.pos[0],self.pos[1],self.pos[2]+random.randint(2,8))
to
self.planet_mesh.setPos(self.pos[0],self.pos[1],self.pos[2]+random.randint(2,8))
solves the problem. now the planet moves. but it stuffs up the moons which now orbit around 0,0,0