我试图在球体上添加一些文字 - 图形节点的标签。
例如,在下面的图形中,我想为每个节点加上标签。
#include "colors.inc"
global_settings {
assumed_gamma 1.0
ambient_light Gray
}
light_source { <100,00,-150> color White }
camera {
sky <0, 0, -1>
look_at <0, 0, 0>
location <20, -80, -160>
}
plane { <0,0,-1>, 0
pigment { color White }
}
sphere {
< -50,-33,-50 > , 8
texture { pigment { color rgb 0.7 }}
}
sphere {
< 50,-50,-50 > , 8
texture { pigment { color rgb<1.0, 0.0, 0.0> }}
}
cylinder {
< -50,-33,-50 >, < 50,-50,-50 > ,1
texture { pigment { color rgb 0.5 }}
}
我可以向绘图添加文本,但该文本不在球体表面上。
text{ttf "crystal.ttf", "word", 0, 0
pigment {Black}
scale 10
translate < -50,-33,-50 >
}
通过浏览网页,我认为可能可以将文本作为纹理添加到球体上,但我没有成功 - 没有文本显示。
#macro my_node(Text)
#declare word=texture{
pigment{object{
text{ttf "crystal.ttf", Text, 0, 0 pigment {Black} scale 25}
colour Clear }
}
}
sphere {< 0, 0, 0>, 8
texture { pigment { color rgb 0.7 }}
texture{word}
}
#end
object {my_node("word")
translate < -50,-33,-50 >
}
我的问题:如何在球体上添加标签。谢谢。
povray
中,可以编写一个依赖于函数的纹理,该函数由对象的内部确定,该对象可以是文本对象。我不知道具体细节(我需要从povray
文档中查找),但除了直接使用依赖于磁盘图像输入的纹理外,我相信这是获得包含文本的纹理的唯一方法。 - cmaster - reinstate monica