|
CG では、赤(R)と緑(G)と青(B)の3色を
VRML では、R,G,B ともに、0.0 から 1.0 までの |
以下の例では、それぞれの色を表す数字を、
R,G,B の順に続けて記述したものです。
以下、赤い円すいと黄色い円柱の記述例です。
ここで、diffuseColor と書いてある行を見てください。
前半の diffuseColor の後には、1.0 0.0 0.0 と書いてあります。
これが「赤」を表しています。
前半の diffuseColor の後には、1.0 1.0 0.0 と書いてあります。
これが「黄」を表しています。
#VRML V2.0 utf8
Transform {
translation 3.0 0.0 0.0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 0.0 0.0
}
}
geometry Cone {
height 3.0
bottomRadius 2.0
}
}
]
}
Transform {
translation -3.0 0.0 0.0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 1.0 0.0
}
}
geometry Cylinder {
height 2.0
radius 2.0
}
}
]
}
|