如何使鼠标拖动方向统一
大家好,我正在建立一个3D游戏,玩家可以重塑粘液之类的东西,并拖动它。塑形部分还不错,我对此没有问题。 我使用网状操作来塑造物体,然后将所有顶点移动到点击位置的特定半径内。但是我的顶点正朝着正常的向量移动,我发现我可以通过更改正常向量将顶点移动到鼠标阻力矢量。
因此,这是我的问题如何获得鼠标拖动向量,以便可以将正常向量更改为此?
另外,玩家可以在我的对象上旋转X和Y轴,这使此问题变得更加困难。
因为例如,如果我从此角度看到我的对象(270,0,0)
如果玩家将鼠标拖动到右下方,我的对象应延伸至其-x轴和-Z轴。
Hello guys I am building a 3D game that player can reshape something like slime with dragging it. the shaping part is alright and I do not have a problem with it.
I use mesh manipulation for shaping my object and I move all vertices within a specific radius of clicked position. but my vertices are moving toward its normal vector I figured that out I can move vertices toward mouse drag vector by just changing normal vectors.
so, here is my question how can I get mouse drag vector so I can change my normal vector to that?
also the player can rotate around X And Y Axis on my object and this makes this problem a little more difficult.
because for example if I see my object from this angle (270,0,0)
if players drag mouse to right and down my object should Stretch to its -x Axis and -z Axis.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论