Threejs draw two-dimensional circle (ARC)

Source: Internet
Author: User

Draw a circle: var radius = 40,segments = 64,material = new three. Linebasicmaterial ({color:0x0000ff}), Geometry = new three. Circlegeometry (radius, segments);
//Remove Center vertexGeometry.vertices.shift ();
This.scene.add (new three. Line (geometry, material)); Using Three.line will result in the last and 1th unlinked, available This.scene.add (new three.Lineloop(geometry, material)); Draw circles are also available (this method can be set to draw arcs) let points = [],length = 100,circle = 40;for (Let i = 0; I <= length; i++) {Points.push (new three.v Ector2 (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) Note: This method draws a circle and cannot be closed at the end

Threejs draw two-dimensional circle (ARC)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.