pixelTexture.wrl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #VRML V2.0 utf8
  2. Group { children [
  3. Transform {
  4. translation -2.5 0 0.5
  5. rotation 0 1 0 0.5
  6. children Shape {
  7. appearance Appearance {
  8. texture PixelTexture { # One component (gray scale)
  9. image 4 4 1 0x00 0xDD 0xAA 0xFF
  10. 0xDD 0x00 0xDD 0x00
  11. 0xAA 0xDD 0x00 0x00
  12. 0xFF 0x00 0x00 0x00
  13. }
  14. # Notice how the diffuseColor darkens the texture
  15. material DEF M Material { diffuseColor .7 .7 .7 }
  16. }
  17. geometry DEF IFS IndexedFaceSet {
  18. coord Coordinate {
  19. point [ -1.1 -1 0, 1 -1 0, 1 1 0, -1.1 1 0 ] }
  20. coordIndex [ 0 1 2 3 ]
  21. texCoord TextureCoordinate { point [ 0 0, 3 0, 3 3, 0 3 ] }
  22. }
  23. }
  24. }
  25. Transform {
  26. translation 0 0 0
  27. children Shape {
  28. appearance Appearance {
  29. # For faster rendering, do not specify a Material
  30. # and avoid lighting calculations on the texture.
  31. texture PixelTexture {
  32. image 2 2 3 0xFFFFFF 0xAAAAAA 0xDDDDDD 0x000000
  33. }
  34. }
  35. geometry USE IFS
  36. }
  37. }
  38. Transform {
  39. translation 2.5 0 0
  40. children Shape {
  41. appearance Appearance {
  42. texture PixelTexture {
  43. image 2 2 4 0xFFFFFF00 0xAAAAAAA0 0xDDDDDDA0 0x000000AA
  44. }
  45. material DEF M Material {
  46. diffuseColor 0 0 0 # diffuseColor and transp have no
  47. transparency 1.0 # effect - replaced by image values.
  48. shininess 0.5 # All other fields work fine.
  49. ambientIntensity 0.0
  50. }
  51. }
  52. geometry USE IFS
  53. }
  54. }
  55. Transform {
  56. translation 5 0 0
  57. children Shape {
  58. appearance Appearance {
  59. texture PixelTexture { # repeat fields
  60. image 4 4 1 0x00 0xDD 0xAA 0xFF
  61. 0xDD 0x00 0xDD 0x00
  62. 0xAA 0xDD 0x00 0x00
  63. 0xFF 0x00 0x00 0x00
  64. repeatS FALSE
  65. repeatT FALSE
  66. }
  67. material DEF M Material { diffuseColor 1 1 1 }
  68. }
  69. geometry IndexedFaceSet {
  70. coord Coordinate { point [ -1 -1 0, 1 -1 0, 1 1 0, -1 1 0 ] }
  71. coordIndex [ 0 1 2 3 ]
  72. texCoord TextureCoordinate {
  73. point [ -0.25 -0.5, 1.25 -0.5, 1.25 1.5, -0.25 1.5 ]
  74. }
  75. }
  76. }
  77. }
  78. Background {
  79. skyColor [ 1 1 1, 1 1 1, .5 .5 .5, 1 1 1, .2 .2 .2, 1 1 1 ]
  80. skyAngle [ 1.35, 1.4, 1.45, 1.5, 1.55 ]
  81. groundColor [ 1 1 1, 1 1 1, 0.4 0.4 0.4 ]
  82. groundAngle [ 1.3, 1.57 ]
  83. }
  84. NavigationInfo { type "EXAMINE" }
  85. Viewpoint { position 0 1 6 orientation -.707 0 -.707 0 }
  86. ]}