three.js

how to make a fog effect or blur effect in canvas with js?

邮差的信 提交于 2020-04-30 07:36:42
问题 I'm using javascript and THREE.js 3d engine, and I want to do a fog effect, here's an example http://mrdoob.github.com/three.js/examples/webgl_geometry_terrain_fog.html but it only support WebGL , so is there any way to simulate fog effect , or a blur effect with javascript and canvas? thanks alot. 回答1: Three.js is WebGL. The example you're looking at is created by the same person who made three.js. Three.js supports fog already with scene.fog . https://github.com/mrdoob/three.js/wiki/API

how to make a fog effect or blur effect in canvas with js?

冷暖自知 提交于 2020-04-30 07:35:08
问题 I'm using javascript and THREE.js 3d engine, and I want to do a fog effect, here's an example http://mrdoob.github.com/three.js/examples/webgl_geometry_terrain_fog.html but it only support WebGL , so is there any way to simulate fog effect , or a blur effect with javascript and canvas? thanks alot. 回答1: Three.js is WebGL. The example you're looking at is created by the same person who made three.js. Three.js supports fog already with scene.fog . https://github.com/mrdoob/three.js/wiki/API

Why is my Three.js animation slower in Vue.js?

廉价感情. 提交于 2020-04-30 06:46:26
问题 I'm trying to recreate this awesome wave simulation: https://codepen.io/cheekymonkey/pen/vMvYNV, in Vue.js. However the animation is really slow when I've recreated it in Vue.js I've tried making all of the same functions as Vue.js methods and including the variables in the component's data property. <template> <div id="container" style="width:100%; height:100vh;"></div> </template> <script> import * as Three from 'three' import SimplexNoise from'simplex-noise' export default { name:

当微信小程序遇到AR(四)

我怕爱的太早我们不能终老 提交于 2020-04-29 17:00:44
当 微信小程 序遇到 AR ,会擦出怎么样的 火花 ? 期待 与 激动 ...... 通过该教程,可以从基础开始打造一个微信小程序的AR框架,所有代码开源,提供大家学习。 本课程需要一定的基础:微信开发者工具,JavaScript,Html,Css 第四章:基石-摄像头与Three.js结合 【前情提要】   上一章,前面的两章内容,我们学习了基本的摄像头数据读取以及Three.js三维场景的创建。这两章内容学习之后,我们已经可以做很多更定制化的开发了。例如:   1. 我们已经可以做基于摄像头图像的AR内容开发,(比如人脸识别,AR美妆涂口红,戴帽子,适眼镜等等)   2. WebGL的三维游戏。   这一章,既是基础也是升华,主要是探讨,如何在微信小程序中出现摄像头画面的背景,然后在背景之上渲染出WebGL的三维内容。 1. 实现在微信小程序中访问摄像头,并且可以实时的拿到每一帧画面的数据。 2. 实现在微信小程序中访问WebGL接口,实现绘制三维物体。该教程采用Three.js引擎 3. 实现在背景为摄像头实时画面的背景上显示WebGL的3D物体。 4. 整体框架搭建 5. 图像算法接入 【目的】 微信小程序中实现摄像头画面为背景,之上渲染WebGL内容 [方案]   在开始开发之前,我们想罗列一下各种可能的方案。   要想在摄像头画面之上渲染出WebGL的内容

cannot change material color using three.js

只谈情不闲聊 提交于 2020-04-18 06:21:35
问题 I have a obj file which contains vertex groups along with the main object. I am trying to assign color to each of the groups tagged through vertex group. What I could find is that in three.js each vertex group is of type Object3D and there is no function like setColor , instead each such children has two children of the type THREE.Mesh and it has setColor function accessed through a material property. I am not clear about this hierarchy. How do I set color to each vertex group. One more thing

DragControl not working on Android Webview (problem dragging 3d models)

扶醉桌前 提交于 2020-04-18 00:47:07
问题 ,Greetings! this question is the for the problem which I barged into after I was helped with this. This code is working fine on web browsers directly but when I try to run it Android WebView, it's not working.These are the logs which i am getting once the app starts in android studio: D/CONTENT: THREE.WebGLRenderer: Error creating WebGL context. @ 23538: https://cdn.jsdelivr.net/npm/three@0.115/build/three.js D/CONTENT: Uncaught Error: Error creating WebGL context. @ 23539: https://cdn

DragControl not working on Android Webview (problem dragging 3d models)

北城余情 提交于 2020-04-18 00:37:35
问题 ,Greetings! this question is the for the problem which I barged into after I was helped with this. This code is working fine on web browsers directly but when I try to run it Android WebView, it's not working.These are the logs which i am getting once the app starts in android studio: D/CONTENT: THREE.WebGLRenderer: Error creating WebGL context. @ 23538: https://cdn.jsdelivr.net/npm/three@0.115/build/three.js D/CONTENT: Uncaught Error: Error creating WebGL context. @ 23539: https://cdn

GPU Picking inconsistent across devices

孤者浪人 提交于 2020-04-17 22:33:14
问题 I’m trying to implement GPU picking with Points using code I modified from the latter half of this article https://threejsfundamentals.org/threejs/lessons/threejs-picking.html It’s been working fine for me on desktop, but I started testing different browsers and devices and it doesn’t work consistently. I made a Codepen to illustrate https://codepen.io/deklanw/pen/OJVVmEd?editors=1111 body { margin: 0; } #c { width: 100vw; height: 100vh; display: block; } <canvas id="c"></canvas> <script type

Unable to use DragControls

我与影子孤独终老i 提交于 2020-04-16 02:32:11
问题 I am a beginner with three.js and I was trying to implement a feature where one must be able to drag a 3d model. I came across DragControl in this process and I am not able to use it in my code. when I use new DragControls(objects, camera, renderer.domElement) I get this error capture.js:9 Uncaught ReferenceError: DragControls is not defined at capture.js:9 and when i use the new THREE.DragControls(objects, camera, renderer.domElement) I get This error Uncaught TypeError: THREE.DragControls

Showing Point Cloud Structure using Lighting in Three.js

喜夏-厌秋 提交于 2020-04-14 08:33:27
问题 I am generating a point cloud representing a rock using Three.js, but am facing a problem with visualizing its structure clearly. In the second screenshot below I would like to be able to denote the topography of the rock, like the corner (shown better in the third screenshot) of the structure, in a more explicit way, as I want to be able to maneuver around the rock and select different points. I have rocks that are more sparse (harder to see structure as points very far away) and more dense