画圆:
var radius = 40,
segments = 64,
material = new THREE.LineBasicMaterial({ color: 0x0000ff }),
geometry = new THREE.CircleGeometry(radius, segments); // Remove center vertex
geometry.vertices.shift(); this.scene.add(new THREE.Line(geometry, material));
 
使用THREE.Line会导致最后一点和第一点未链接,可用
this.scene.add(new THREE.LineLoop(geometry, material));
 
 
画圆也可用(该方法可自行设置画圆弧)
let points = [],
length = 100,
circle = 40;
for (let i = 0; i <= length; i++) {
  points.push(new THREE.Vector2(circle * Math.cos(Math.PI * 2 * i / length), circle * Math.sin(Math.PI * 2 * i / length)))
}
let shape = new THREE.Shape(points);
let arcGeometry = shape.makeGeometry()
let arcMaterial = new THREE.LineBasicMaterial({ color: 0x38d3f5 });
let arc = new THREE.Line(arcGeometry, arcMaterial);

this.scene.add(arc)

注:该方法画圆最后无法闭合

threejs 画二维圆(圆弧)的更多相关文章

  1. vue 画二维码

    首先安装一下相关的插件 qrcode2 npm install --save qrcode2 然后在需要画二维码的页面引入一下 import QRCode from 'qrcode2' 最后在meth ...

  2. matplotlib---插值画二维、三维图

    一.画二维图 1.原始数据(x,y) import matplotlib.pyplot as plt import numpy as np #数据 X = np.array(list(i for i ...

  3. matlab画二维直方图以及双y轴坐标如何修改另一边y轴的颜色

    1.首先讲一下如何用hist画二维直方图 x=[- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ...

  4. MFC画二维动态图表[GDI]

    源博客:http://www.codeproject.com/Articles/9350/2D-Animated-Charts 源代码:http://download.csdn.net/detail/ ...

  5. matlab 画二维图与三维图

    二维图 ezplot('sin(x)');%默认范围 ezplot('sin(x)',[-4 4]);%自己设定范围 三维图 ezmesh('x*x+y*y');%默认范围

  6. js通过codeURL画二维码

    一.函数封装 //生成微信二维码 function xyqrcode(options) { var settings = { dom:'', render: 'canvas', //生成二维码的格式还 ...

  7. python3怎样画二维点图

    引用自:http://www.cnblogs.com/super-zhang-828/p/4792206.html import matplotlib.pyplot as pltplt.plot([1 ...

  8. pgfplots画二维图真的很方便,多例比较

    %直接PDFLATEX编译即可\documentclass[border=1mm]{standalone}\usepackage{tkz-euclide,pgfplots}\begin{documen ...

  9. java画海报二维码

    package cn.com.yitong.ares.qrcode; import java.awt.BasicStroke;import java.awt.Color;import java.awt ...

随机推荐

  1. windows向github提交代码

    随便写的,留给自己看. 一.在github上注册并建立自己的仓库http://www.cnblogs.com/keZhenxu94/p/5288488.html 二.安装windows版本git界面工 ...

  2. gitflow工作流程基本命令使用

    1 基础命令: 初始化: git flow init 开始新Feature: git flow feature start MYFEATURE Publish一个Feature(也就是push到远程) ...

  3. 1-12 RHEL7-find命令的使用

    1.文件查找findfind命令是在目录结构中,搜索文件,并执行特定的操作find命令提供了相当多的查找条件,功能很强大 2.格式usage:find pathname -options[-print ...

  4. poj 1724 ROADS 很水的dfs

    题意:给你N个城市和M条路和K块钱,每条路有话费,问你从1走到N的在K块钱内所能走的最短距离是多少 链接:http://poj.org/problem?id=1724 直接dfs搜一遍就是 代码: # ...

  5. iOS开发图片加载的内存问题及优化方案

    原创作者:Magic-Unique 原文地址:https://github.com/Magic-Unique/HXImage猿吧 - 资源共享论坛: http://www.coderbar.cn 做最 ...

  6. FreeMarker初探--安装FreeMarker

    这里安装FreeMarker相当简单,不需要真正的安装过程.仅仅是拷贝 lib/freemarker.jar 到你 Java 应用程序的路径中,让类加载器可以发现它.比如,如果你在 Web 使用了 F ...

  7. 由浅入深了解EventBus:(五)

    事件分发 EventBus3.0的事件的分发时通过EventBus类中的post(粘性事件为postSticky)方法,post与postSticky的唯一区别就是,在postSticky内部首先会向 ...

  8. 一款连接SqlServer的数据库工具

    由于自己使用的电脑系统是xp,而服务器上的数据库是SqlServer2012,于是用SqlServer2005管理端操作2012,总是不成功.在网上也百度谷歌了很久,也没有解决,也发了很多问没有找到解 ...

  9. JSON数组字典解析

    遇到这样的字典数组字符串 priceRange = "[{\"id\":149075584861800,\"price\":9.9,\"nu ...

  10. this指针逃逸问题

    this指针逃逸是指在构造函数返回之前,其他线程已经就持有了该对象的应用,产生的结果自然和预期可能会产生差异.常见的this指针逃逸,在并发编程实战一书中,作者指出:在构造函数中注册事件监听,在构造函 ...