简体   繁体   English

如何在python Ursina Engine模块中通过z轴拖动object?

[英]How to Drag object by z-axis in python Ursina Engine module?

I can't drag my 3d WOOD object by z-axis .我不能通过z-axis拖动我的 3d WOOD object 。 I tried:我试过:

class Wood(Draggable):
    def __init__(self):
        super().__init__(
            parent='scene'
            model='wood'
            --all another parametres--
        )

# it doesn't work. Wood moving only by x-axis and y-axis.

Do .plane_direction=(0,1,0) and .lock=(1,1,0) Changing plane_direction will point the plane you drag along towards that direction.执行.plane_direction=(0,1,0).lock=(1,1,0)更改 plane_direction 会将您拖动的平面指向该方向。

You should also set the parent to scene , not 'scene' .您还应该将父级设置为scene ,而不是'scene'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM