Three.js 椭圆 [英] Three.js Ellipse

查看:67
本文介绍了Three.js 椭圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在three.js中创建一个椭圆?

How does one go about creating an ellipse in three.js?

我看过这个:在 THREE.js 中绘制椭圆

但是如果有人能提供一个可行的例子会很酷.

But it would be cool if someone could provide a working example.

我已经试过了:

ellipse = new THREE.EllipseCurve(0,0,200,400,45,45,10);

但这对我不起作用.我不知道这些参数是什么意思,所以我只是盲目地去做.

but that's not working for me. I have no idea what the parameters mean so I'm just blindly going about it.

当我尝试创建椭圆曲线时,出现错误定义的不是函数".

edit: I am getting the error "defined is not a function" when I try to create an ellipse curve.

edit2:发现我必须包含 Curves.js 才能使其工作,但在某处有一个工作示例对我和其他人来说仍然非常好,因为我之前粘贴的 stackoverflow 链接没有示例.

edit2: Figured out I had to include Curves.js for it to work but having a working example somewhere would still be really nice for me and other people since the stackoverflow link I pasted earlier doesn't have an example.

推荐答案

我对THREE.js不熟悉,但是看了一下代码 参数好像是
(Center_Xpos, Center_Ypos, Xradius, Yradius, StartAngle, EndAngle, isClockwise)所以你的定义不起作用的一个原因是你将开始和结束角度都设置为同一件事.

I am unfamiliar with THREE.js, but looking at the code the parameters seem to be
(Center_Xpos, Center_Ypos, Xradius, Yradius, StartAngle, EndAngle, isClockwise) so a reason your definition isn't working is because you're setting the start and end angles both to the same thing.

这篇关于Three.js 椭圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆