简体   繁体   English

用Javascript绘制3D元素

[英]Drawing 3D elements with Javascript

My application returns the relative positions between two lines and I want draw this lines with Javascript. 我的应用程序返回两行之间的相对位置,我想用Javascript绘制这行。 The line is defined with a director vector, a point and is three dimension . 这条线由一个指向矢矢量,一个点定义并且是三维的
Is there any library available which can do this? 是否有可用的图书馆可以做到这一点? I found only Victor.js but does not help in my case 我只找到了Victor.js,但对我的情况没有帮助

  • Three.js : "The aim of the project is to create a lightweight 3D library with a very low level of complexity — in other words, for dummies. The library provides canvas, svg, CSS3D and WebGL renderers." Three.js :“该项目的目的是创建一个具有非常低的复杂度的轻量级3D库,换句话说,是针对傻瓜。库提供了canvas,svg,CSS3D和WebGL渲染器。”

  • Processing.js : "Processing.js is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins." Processing.js :“ Processing.js是流行的Processing视觉编程语言的姊妹项目,专门为Web设计。Processing.js使您的数据可视化,数字艺术,交互式动画,教育图,视频游戏等都可以通过Web进行工作。标准,并且没有任何插件。”

Both are very mature and have an active community. 两者都很成熟,拥有活跃的社区。 There are plenty of resources to learn from, for example three.js's Getting Started and Processing.js's Learning . 有很多资源可供学习,例如Three.js的入门指南Processing.js的Learning

Here , you have a really easy guide to draw a 3D shape on a 2D surface (With ProcessingJS) 在这里 ,您有一个非常简单的指南来在2D曲面上绘制3D形状(使用ProcessingJS)
Its a guide by Khan Academy to make 3D shapes with ProcessingJS 它是汗学院的指南,使用ProcessingJS制作3D形状

You might want to read THIS too. 您可能也想阅读本内容
Its the original article, by Peter Collingridge 它的原始文章,彼得·科林里奇(Peter Collingridge)
Draw 3d shapes on html5 canvas 在HTML5画布上绘制3D形状

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM