小编enz*_*uri的帖子

如何围绕Z轴绕3D运行

我主要是一个Flash AS3开发人员,但是我跳进了openframeworks并且在使用3D时遇到了麻烦(这些例子在AS中)

在2D中,您可以使用Math.Sin()和模拟围绕点旋转的对象Math.cos(),就像这样

function update(event:Event):void
{
    dot.x = xCenter + Math.cos(angle*Math.PI/180) * range;
    dot.y = yCenter + Math.sin(angle*Math.PI/180) * range;
    angle+=speed;
}
Run Code Online (Sandbox Code Playgroud)

我想知道如果我想在第三维轨道运行,我将如何将其转换为3D轨道.

function update(event:Event):void
{
    ...
    dot.z = zCenter + Math.sin(angle*Math.PI/180) * range;
    // is this valid?
}
Run Code Online (Sandbox Code Playgroud)

非常感谢帮助.

c++ math geometry openframeworks

4
推荐指数
1
解决办法
3459
查看次数

标签 统计

c++ ×1

geometry ×1

math ×1

openframeworks ×1