Three.js 线的颜色渐变 [英] Color Gradient for Three.js line

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

问题描述

我只能找到 THREE.LineBasicMaterial().有没有办法从a点到b点有一个简单的颜色渐变?

I only can find THREE.LineBasicMaterial(). Is there a way to have a simple color gradient from point a to point b?

推荐答案

您可以使用 Vertex &用于更改顶点 [0] 和顶点 [1] 颜色的片段着色器.(线点)请参阅 http://mrdoob.github.com/three.js/examples/webgl_custom_attributes_lines.html

You can use Vertex & fragment shaders for change color for vertices[0] and vertices[1]. (Line points) See http://mrdoob.github.com/three.js/examples/webgl_custom_attributes_lines.html

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

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