1#Inventor V2.1 ascii 2 3# Check all aspects of rendering with SoPolygonOffset nodes. 4# NB: the Translation offset is dependent on the OpenGL implementation. 5# 6# 19990504 mortene 7 8Separator { 9 Switch { 10 whichChild -1 11 # This'll give artifacts for Mesa 3.0 on Linux x86, which we 12 # need to be able to test SoPolygonOffset. 13 DEF offset Translation { translation 0 0 -0.000001} 14 } 15 16 Switch { 17 whichChild -1 18 DEF faces Group { 19 Coordinate3 { 20 point [ 21 -2 -1 0, -1 -1 0, 1 -1 0, 2 -1 0, 22 -2 1 0, -1 1 0, 1 1 0, 2 1 0, 23 ] 24 } 25 IndexedFaceSet { 26 coordIndex [ 0, 1, 5, 4, -1, 1, 2, 6, 5, -1, 2, 3, 7, 6, -1] 27 } 28 } 29 } 30 31 Switch { 32 whichChild -1 33 DEF lines Group { 34 Coordinate3 { 35 point [ 36 -2 -1 0, -1 -1 0, 1 -1 0, 2 -1 0, 37 -2 1 0, -1 1 0, 1 1 0, 2 1 0, 38 ] 39 } 40 IndexedLineSet { 41 coordIndex [ 0, 3, 7, 0, 4, 7, -1 ] 42 } 43 } 44 } 45 46 # (ROW 0) 47 Separator { 48 Separator { 49 BaseColor { rgb 1 0 0 } 50 USE faces 51 52 USE offset 53 BaseColor { rgb 0 1 0 } 54 USE faces 55 } 56 57 Translation { translation +6 0 0 } 58 Separator { 59 BaseColor { rgb 1 0 0 } 60 USE faces 61 62 PolygonOffset { } 63 64 USE offset 65 BaseColor { rgb 0 1 0 } 66 USE faces 67 } 68 69 Translation { translation +6 0 0 } 70 Separator { 71 BaseColor { rgb 1 0 0 } 72 USE faces 73 74 PolygonOffset { factor -1 } 75 76 USE offset 77 BaseColor { rgb 0 1 0 } 78 USE faces 79 } 80 } 81 82 # (ROW 1) 83 Translation { translation 0 +4 0 } 84 Separator { 85 Separator { 86 BaseColor { rgb 1 0 0 } 87 USE faces 88 89 PolygonOffset { styles LINES } 90 91 USE offset 92 BaseColor { rgb 0 1 0 } 93 USE faces 94 } 95 96 Translation { translation +6 0 0 } 97 Separator { 98 BaseColor { rgb 1 0 0 } 99 USE faces 100 101 PolygonOffset { 102 styles (FILLED|LINES|POINTS) 103 } 104 105 USE offset 106 BaseColor { rgb 0 1 0 } 107 USE lines 108 } 109 110 Translation { translation +6 0 0 } 111 Separator { 112 BaseColor { rgb 1 0 0 } 113 USE lines 114 115 PolygonOffset { 116 styles (FILLED|LINES|POINTS) 117 } 118 119 USE offset 120 BaseColor { rgb 0 1 0 } 121 USE faces 122 } 123 } 124} 125