direct.gui.OnscreenGeom

Hello everyone,
I try set rotation of geometry object in GUI ( aspect2d )
It will be XYZ Axises model witch should changes hpr relatively to camera rotation.
You could saw it in CAD systems like CATIA, SolidWorks or Blender.


Please, tell me what is the best solution to pin XYZ model hpr to World hpr relatively camera rotation?
I tried the following:

    def updateDebugAxis(self, task=None):
        self.debugAxis.setHpr(self.camera.getHpr())
        return Task.cont

but result is not satisfied.

Thanks.

You can use a CompassEffect to lock a node’s rotation, position or scale to any other node in the scene graph.

For example, you could reparent your xyzAxis to the camera and adjust its position so that it appears in the corner of the camera view, and then you can make sure it maintains its rotation relative to the root of the scene graph:

self.debugAxis.setCompass(self.render)

Rdb thank you a lot!

I understood you comment.
I think xyzAxis should be pin not to base.camera , but to nearest frustum plane.
Is it any good solution for that?
Thanks :sunglasses:

It looks like this problem has been addressed before:

Perhaps that post would solve your problem?

Perfect, now it works as was suspected.
Thank You.