我正在尝试向球体添加一些文字 - 图形节点上的标签。将文字添加到球体表面
因此,例如,在下面的图表中,我想要标记每个节点。
#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 >
}
My question
:我如何添加标签到球吧。 谢谢
它是在'povray'可能写的纹理取决于一个函数,这是由一个物体的内部,其可以是一个文字对象来确定。我不知道细节(我必须从'povray'文档中查看它们),但除了直接使用依赖于磁盘映像输入的纹理之外,我相信它是获得包含文本的纹理的唯一方法。 – cmaster
@cmaster;感谢您的信息 - 听起来很有希望,因为这可能是可能的。 – user2957945
cmaster的评论提到的是你正在尝试做的事情。这不会将文字沿着球体弯曲,如果您能够正常工作,无论如何都会发生扭曲。但是,首先尝试匹配球体和纹理大小 - 我建议尝试渲染单位大小的所有东西,接近原点并在此之后进行翻译。 (所以,放下“刻度25”并放置一个半径为1的球体。当你看到一些文字时,开始摆弄变形) – jsbueno