I am trying to add some text to a sphere - labels on nodes of a graph.
So for example, in the graph below, I'd like each node labelled.
#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 }}
}
I can add text to the plot generally but it is not on the spheres surface
text{ttf "crystal.ttf", "word", 0, 0
pigment {Black}
scale 10
translate < -50,-33,-50 >
}
From browsing web , I thought it may be possible to add the text as a texture to the sphere, but I have had no success - no text appears.
#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
: How can I add labels onto a sphere please. thanks