Forums > MaxMSP

GL and slicing shapes

September 1, 2009 | 7:26 pm

Hi

I’m trying to use gl in DIPS to remove the side of a cube so that it becomes a box that can be seen into. The opengl commands, which I’m struggling with anyway, are passed through the objects DGLEnable and DGLPushAttrib but I can’t figure out which to use / how to order them. Has anybody here any experience with DIPS or can anyone explain to me how as opengl commands these are ordered so I can try and map that to the DIPS equivalent.

What I have so far is below. Thanks in advance.

a+
gar

max v2;
#N vpatcher 522 44 1039 886;
#P origin 94 -104;
#P window setfont "Sans Serif" 9.;
#P newex 82 133 133 196617 DGLEnable GL_DEPTH_TEST;
#P newex 82 113 65 196617 DlibDepth on;
#P comment 309 708 134 196617 Position and Rotation;
#P comment 309 501 134 196617 Camera position;
#P comment 184 704 47 196617 Rotation;
#P flonum 253 362 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 217 347 13 196617 B;
#P comment 181 347 14 196617 G;
#P comment 145 347 14 196617 R;
#P flonum 217 362 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 181 362 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 145 362 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 381 222 196617 DGLLight GL_LIGHT0 GL_SPECULAR 0. 0. 0.3 1.;
#P flonum 253 308 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 217 293 13 196617 B;
#P comment 181 293 14 196617 G;
#P comment 145 293 14 196617 R;
#P flonum 217 308 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 181 308 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 145 308 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 327 210 196617 DGLLight GL_LIGHT0 GL_AMBIENT 1. 1. 1. 1.;
#P flonum 253 254 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 217 239 13 196617 B;
#P comment 181 239 14 196617 G;
#P comment 145 239 14 196617 R;
#P flonum 217 254 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 181 254 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 145 254 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 242 185 13 196617 z;
#P comment 206 185 14 196617 y;
#P comment 170 185 14 196617 x;
#P flonum 242 200 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 206 200 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 170 200 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 273 205 196617 DGLLight GL_LIGHT0 GL_DIFFUSE 1. 1. 1. 1.;
#P newex 82 220 218 196617 DGLLight GL_LIGHT0 GL_POSITION -20 -20 13;
#P newex 82 796 269 196617 DGLClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT;
#P comment 201 577 34 196617 Move;
#P comment 184 643 47 196617 Rotation;
#P comment 261 446 39 196617 center;
#P comment 307 461 13 196617 z;
#P comment 270 461 13 196617 y;
#P comment 234 461 13 196617 x;
#P comment 197 461 13 196617 z;
#P comment 160 461 13 196617 y;
#P flonum 297 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 260 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 223 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 186 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 149 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 112 475 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 495 184 196617 DGLULookAt 0. 0. 300. 0. 0. 0. 0. 1. 0.;
#P comment 107 431 266 196617 Define camera position(eye) , where to see(center);
#P comment 123 461 13 196617 x;
#P comment 151 446 24 196617 eye;
#N vpatcher 681 259 1307 651;
#P origin -177 23;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 247 231 140 196617 DGLDisable GL_CLIP_PLANE3;
#P newex 217 92 151 196617 DGLPushAttrib GL_ENABLE_BIT;
#P newex 23 114 151 196617 DGLPushAttrib GL_ENABLE_BIT;
#P window setfont "Sans Serif" 10.;
#N vpatcher 518 80 965 589;
#P origin 0 302;
#P window setfont "Sans Serif" 10.;
#P comment 47 -271 76 196618 more_details;
#P comment 68 -257 277 196618 glPushAttrib takes one argument , a mask that indicates;
#P comment 68 -243 277 196618 which groups of state variables to save on the attribute;
#P comment 68 -229 259 196618 stack. Symbolic constants are used to set bits in the;
#P comment 68 -215 281 196618 mask. mask is typically constructed by ORing several of;
#P comment 68 -201 214 196618 these constants together. The special mask;
#P comment 68 -187 277 196618 GL_ALL_ATTRIB_BITS can be used to save all stackable;
#P comment 68 -173 41 196618 states.;
#P comment 47 -145 289 196618 The symbolic mask constants and their associated GL state;
#P comment 68 -131 282 196618 are as follows (the second column lists which attributes;
#P comment 68 -117 64 196618 are saved):;
#P comment 47 -103 17 196618;
#P comment 68 -89 283 196618 l l . GL_ACCUM_BUFFER_BIT Accumulation buffer clear;
#P comment 68 -75 36 196618 value;
#P comment 47 -49 296 196618 GL_COLOR_BUFFER_BIT GL_ALPHA_TEST enable bit Alpha;
#P comment 68 -35 275 196618 test function and reference value GL_BLEND enable bit;
#P comment 83 -21 237 196618 Blending source and destination functions Con-;
#P comment 68 -7 238 196618 stant blend color Blending equation GL_DITHER;
#P comment 68 7 192 196618 enable bit GL_DRAW_BUFFER setting;
#P comment 83 21 273 196618 GL_COLOR_LOGIC_OP enable bit GL_INDEX_LOGIC_OP;
#P comment 68 35 218 196618 enable bit Logic op function Color mode and;
#P comment 68 49 256 196618 index mode clear values Color mode and index mode;
#P comment 68 63 67 196618 writemasks;
#P comment 47 91 297 196618 GL_CURRENT_BIT Current RGBA color Current color index;
#P comment 83 105 242 196618 Current normal vector Current texture coordi-;
#P comment 68 119 153 196618 nates Current raster position;
#P comment 83 133 287 196618 GL_CURRENT_RASTER_POSITION_VALID flag RGBA color;
#P comment 68 147 258 196618 associated with current raster position Color index;
#P comment 68 161 272 196618 associated with current raster position Texture coor-;
#P comment 68 175 237 196618 dinates associated with current raster position;
#P comment 83 189 106 196618 GL_EDGE_FLAG flag;
#P comment 47 216 300 196618 GL_DEPTH_BUFFER_BIT GL_DEPTH_TEST enable bit Depth;
#P comment 68 230 227 196618 buffer test function Depth buffer clear value;
#P comment 83 244 181 196618 GL_DEPTH_WRITEMASK enable bit;
#P comment 47 266 313 196618 GL_ENABLE_BIT GL_ALPHA_TEST flag GL_AUTO_NORMAL flag;
#P comment 83 280 252 196618 GL_BLEND flag Enable bits for the user-definable;
#P comment 68 294 272 196618 clipping planes GL_COLOR_MATERIAL GL_CULL_FACE;
#P comment 68 308 215 196618 flag GL_DEPTH_TEST flag GL_DITHER flag;
#P comment 83 322 275 196618 GL_FOG flag GL_LIGHTi where 0 < = i #P comment 83 336 209 196618 GL_LIGHTING flag GL_LINE_SMOOTH flag;
#P comment 83 350 251 196618 GL_LINE_STIPPLE flag GL_COLOR_LOGIC_OP flag;
#P comment 83 364 261 196618 GL_INDEX_LOGIC_OP flag GL_MAP1_x where x is a;
#P comment 68 378 54 196618 map type;
#P comment 48 406 180 196618 GL_MAP2_x where x is a map type;
#P comment 84 420 227 196618 GL_NORMALIZE flag GL_POINT_SMOOTH flag;
#P comment 84 434 167 196618 GL_POLYGON_OFFSET_LINE flag;
#P comment 84 448 166 196618 GL_POLYGON_OFFSET_FILL flag;
#P comment 84 462 287 196618 GL_POLYGON_OFFSET_POINT flag GL_POLYGON_SMOOTH;
#P comment 69 476 258 196618 flag GL_POLYGON_STIPPLE flag GL_SCISSOR_TEST;
#P comment 69 490 251 196618 flag GL_STENCIL_TEST flag GL_TEXTURE_1D flag;
#P comment 84 504 251 196618 GL_TEXTURE_2D flag GL_TEXTURE_3D flag Flags;
#P comment 69 518 229 196618 GL_TEXTURE_GEN_x where x is S , T , R , or Q;
#P comment 49 550 286 196618 GL_EVAL_BIT GL_MAP1_x enable bits , where x is a map;
#P comment 70 564 264 196618 type GL_MAP2_x enable bits , where x is a map type;
#P comment 85 578 228 196618 1D grid endpoints and divisions 2D grid end-;
#P comment 70 592 252 196618 points and divisions GL_AUTO_NORMAL enable bit;
#P comment 51 618 228 196618 GL_FOG_BIT GL_FOG enable bit Fog color Fog;
#P comment 72 632 214 196618 density Linear fog start Linear fog end Fog;
#P comment 72 646 140 196618 index GL_FOG_MODE value;
#P comment 51 660 17 196618;
#P comment 72 674 301 196618 GL_HINT_BIT GL_PERSPECTIVE_CORRECTION_HINT setting;
#P comment 87 688 296 196618 GL_POINT_SMOOTH_HINT setting GL_LINE_SMOOTH_HINT;
#P comment 72 702 223 196618 setting GL_POLYGON_SMOOTH_HINT setting;
#P comment 87 716 114 196618 GL_FOG_HINT setting;
#P comment 51 748 260 196618 GL_LIGHTING_BIT GL_COLOR_MATERIAL enable bit;
#P comment 87 762 251 196618 GL_COLOR_MATERIAL_FACE value Color material;
#P comment 72 776 273 196618 parameters that are tracking the current color Ambi-;
#P comment 72 790 286 196618 ent scene color GL_LIGHT_MODEL_LOCAL_VIEWER value;
#P comment 87 804 262 196618 GL_LIGHT_MODEL_TWO_SIDE setting GL_LIGHTING;
#P comment 72 818 225 196618 enable bit Enable bit for each light Ambient ,;
#P comment 72 832 263 196618 diffuse , and specular intensity for each light Direc-;
#P comment 72 846 275 196618 tion , position , exponent , and cutoff angle for each light;
#P comment 48 875 253 196618 Constant , linear , and quadratic attenuation factors;
#P comment 69 889 263 196618 for each light Ambient , diffuse , specular , and emis-;
#P comment 69 903 251 196618 sive color for each material Ambient , diffuse , and;
#P comment 69 917 250 196618 specular color indices for each material Specular;
#P comment 69 931 271 196618 exponent for each material GL_SHADE_MODEL setting;
#P comment 48 959 283 196618 GL_LINE_BIT GL_LINE_SMOOTH flag GL_LINE_STIPPLE;
#P comment 69 973 251 196618 enable bit Line stipple pattern and repeat counter;
#P comment 84 987 61 196618 Line width;
#P comment 48 1001 17 196618;
#P comment 69 1015 187 196618 GL_LIST_BIT GL_LIST_BASE setting;
#P comment 47 1045 328 196618 GL_PIXEL_MODE_BIT GL_RED_BIAS and GL_RED_SCALE settings;
#P comment 83 1059 235 196618 GL_GREEN_BIAS and GL_GREEN_SCALE values;
#P comment 83 1073 292 196618 GL_BLUE_BIAS and GL_BLUE_SCALE GL_ALPHA_BIAS and;
#P comment 68 1087 294 196618 GL_ALPHA_SCALE GL_DEPTH_BIAS and GL_DEPTH_SCALE;
#P comment 83 1101 243 196618 GL_INDEX_OFFSET and GL_INDEX_SHIFT values;
#P comment 83 1115 288 196618 GL_MAP_COLOR and GL_MAP_STENCIL flags GL_ZOOM_X;
#P comment 68 1129 255 196618 and GL_ZOOM_Y factors GL_READ_BUFFER setting;
#P comment 47 1161 254 196618 GL_POINT_BIT GL_POINT_SMOOTH flag Point size;
#P comment 47 1175 17 196618;
#P comment 68 1189 226 196618 GL_POLYGON_BIT GL_CULL_FACE enable bit;
#P comment 83 1203 281 196618 GL_CULL_FACE_MODE value GL_FRONT_FACE indicator;
#P comment 83 1217 278 196618 GL_POLYGON_MODE setting GL_POLYGON_SMOOTH flag;
#P comment 83 1231 173 196618 GL_POLYGON_STIPPLE enable bit;
#P comment 83 1245 166 196618 GL_POLYGON_OFFSET_FILL flag;
#P comment 83 1259 167 196618 GL_POLYGON_OFFSET_LINE flag;
#P comment 83 1273 174 196618 GL_POLYGON_OFFSET_POINT flag;
#P comment 83 1287 306 196618 GL_POLYGON_OFFSET_FACTOR GL_POLYGON_OFFSET_UNITS;
#P comment 45 1335 255 196618 GL_POLYGON_STIPPLE_BIT Polygon stipple image;
#P comment 45 1349 17 196618;
#P comment 66 1363 268 196618 GL_SCISSOR_BIT GL_SCISSOR_TEST flag Scissor box;
#P comment 45 1377 17 196618;
#P comment 66 1391 285 196618 GL_STENCIL_BUFFER_BIT GL_STENCIL_TEST enable bit;
#P comment 81 1405 222 196618 Stencil function and reference value Stencil;
#P comment 66 1419 259 196618 value mask Stencil fail , pass , and depth buffer pass;
#P comment 66 1433 209 196618 actions Stencil buffer clear value Stencil;
#P comment 66 1447 96 196618 buffer writemask;
#P comment 45 1476 293 196618 GL_TEXTURE_BIT Enable bits for the four texture coordi-;
#P comment 66 1490 245 196618 nates Border color for each texture image Mini-;
#P comment 66 1504 259 196618 fication function for each texture image Magnifica-;
#P comment 66 1518 265 196618 tion function for each texture image Texture coordi-;
#P comment 66 1532 269 196618 nates and wrap mode for each texture image Color and;
#P comment 66 1546 237 196618 mode for each texture environment Enable bits;
#P comment 66 1560 205 196618 GL_TEXTURE_GEN_x , x is S , T , R , and Q;
#P comment 81 1574 256 196618 GL_TEXTURE_GEN_MODE setting for S , T , R , and Q;
#P comment 81 1588 244 196618 glTexGen plane equations for S , T , R , and Q Cur-;
#P comment 66 1602 327 196618 rent texture bindings (for example , GL_TEXTURE_BINDING_2D);
#P comment 46 1631 264 196618 GL_TRANSFORM_BIT Coefficients of the six clipping;
#P comment 67 1645 253 196618 planes Enable bits for the user-definable clipping;
#P comment 67 1659 265 196618 planes GL_MATRIX_MODE value GL_NORMALIZE flag;
#P comment 82 1673 141 196618 GL_RESCALE_NORMAL flag;
#P comment 46 1699 273 196618 GL_VIEWPORT_BIT Depth range (near and far) View-;
#P comment 67 1713 116 196618 port origin and extent;
#P comment 46 1727 17 196618;
#P comment 67 1741 268 196618 glPopAttrib restores the values of the state variables;
#P comment 67 1755 100 196618 saved with the last;
#P comment 67 1769 294 196618 glPushAttrib command. Those not saved are left unchanged.;
#P comment 47 1792 275 196618 It is an error to push attributes onto a full stack , or to;
#P comment 68 1806 264 196618 pop attributes off an empty stack. In either case , the;
#P comment 68 1820 280 196618 error flag is set and no other change is made to GL state.;
#P comment 47 1834 17 196618;
#P comment 68 1848 196 196618 Initially , the attribute stack is empty.;
#P pop;
#P newobj 408 210 113 196618 p push_more_details;
#N vpatcher 10 59 610 459;
#P origin 0 4379;
#P window setfont "Sans Serif" 10.;
#P window linecount 4;
#P comment 47 -4277 354 196618 glEnable and glDisable enable and disable various capabil- ities. Use glIsEnabled or glGet to determine the current setting of any capability. The initial value for each capability with the exception of GL_DITHER is GL_FALSE. The initial value for GL_DITHER is GL_TRUE.;
#P window linecount 5;
#P comment 46 -4175 363 196618 Both glEnable and glDisable take a single argument , cap , which can assume one of the following values: GL_ALPHA_TEST If enabled , do alpha testing. See glAlphaFunc. GL_AUTO_NORMAL If enabled , generate normal vec- tors when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. See glMap2.;
#P window linecount 3;
#P comment 48 -4083 363 196618 GL_BLEND If enabled , blend the incoming RGBA color values with the values in the color buffers. See glBlendFunc. GL_CLIP_PLANEi If enabled , clip geometry against user-defined clipping plane i. See glClipPlane.;
#P window linecount 4;
#P comment 47 -3949 365 196618 GL_COLOR_LOGIC_OP If enabled , apply the currently selected logical operation to the incoming RGBA color and color buffer values. See glLogicOp. GL_COLOR_MATERIAL If enabled , have one or more material parameters track the current color. See glColorMaterial.;
#P comment 46 -3802 373 196618 GL_COLOR_TABLE If enabled , preform a color table lookup on the incoming RGBA color values. See glColorTable. GL_CONVOLUTION_1D If enabled , perform a 1D convolu- tion operation on incoming RGBA color values. See glConvolutionFilter1D.;
#P comment 46 -3672 373 196618 GL_CONVOLUTION_2D If enabled , perform a 2D convolu- tion operation on incoming RGBA color values. See glConvolutionFilter2D. GL_CULL_FACE If enabled , cull polygons based on their winding in window coor- dinates. See glCullFace.;
#P comment 46 -3539 373 196618 GL_DEPTH_TEST If enabled , do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non- zero , the depth buffer is not updated if the depth test is dis- abled. See glDepthFunc and glDepthRange.;
#P window linecount 5;
#P comment 48 -3151 373 196618 GL_LIGHTi If enabled , include light i in the evaluation of the lighting equation. See glLightModel and glLight. GL_LIGHTING If enabled , use the current lighting parameters to compute the vertex color or index. Oth- erwise , simply associate the cur- rent color or index with each vertex. See glMaterial , glLightModel , and glLight.;
#P window linecount 4;
#P comment 46 -2949 373 196618 GL_LINE_SMOOTH If enabled , draw lines with cor- rect filtering. Otherwise , draw aliased lines. See glLineWidth. GL_LINE_STIPPLE If enabled , use the current line stipple pattern when drawing lines. See glLineStipple.;
#P comment 46 -2832 373 196618 GL_MAP1_COLOR_4 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate RGBA values. See glMap1. GL_MAP1_INDEX If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate color indices. See glMap1.;
#P comment 48 -2689 373 196618 GL_MAP1_NORMAL If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate normals. See glMap1. GL_MAP1_TEXTURE_COORD_1 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate s texture coordinates. See glMap1.;
#P window linecount 3;
#P comment 47 -3403 373 196618 GL_DITHER If enabled , dither color compo- nents or indices before they are written to the color buffer. GL_FOG If enabled , blend a fog color into the posttexturing color. See glFog.;
#P window linecount 4;
#P comment 47 -3291 373 196618 GL_HISTOGRAM If enabled , histogram incoming RGBA color values. See glHistogram. GL_INDEX_LOGIC_OP If enabled , apply the currently selected logical operation to the incoming index and color buffer indices. See glLogicOp.;
#P window linecount 5;
#P comment 49 -2547 373 196618 GL_MAP1_TEXTURE_COORD_2 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate s and t texture coordinates. See glMap1. GL_MAP1_TEXTURE_COORD_3 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate s , t , and r texture coordinates. See glMap1.;
#P comment 48 -2402 373 196618 GL_MAP1_TEXTURE_COORD_4 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate s , t , r , and q texture coordinates. See glMap1. GL_MAP1_VERTEX_3 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate x , y , and z vertex coordinates. See glMap1.;
#P window linecount 4;
#P comment 48 -2238 373 196618 GL_MAP1_VERTEX_4 If enabled , calls to glEvalCoord1 , glEvalMesh1 , and glEvalPoint1 generate homogeneous x , y , z , and w vertex coordi- nates. See glMap1. GL_MAP2_COLOR_4 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate RGBA val- ues. See glMap2.;
#P comment 47 -2076 373 196618 GL_MAP2_INDEX If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate color indices. See glMap2. GL_MAP2_NORMAL If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate normals. See glMap2.;
#P window linecount 5;
#P comment 49 -1914 373 196618 GL_MAP2_TEXTURE_COORD_1 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate s texture coordinates. See glMap2. GL_MAP2_TEXTURE_COORD_2 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate s and t texture coordinates. See glMap2.;
#P comment 49 -1772 373 196618 GL_MAP2_TEXTURE_COORD_3 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate s , t , and r texture coordinates. See glMap2. GL_MAP2_TEXTURE_COORD_4 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate s , t , r , and q texture coordinates. See glMap2.;
#P comment 47 -1614 373 196618 GL_MAP2_VERTEX_3 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate x , y , and z vertex coordinates. See glMap2. GL_MAP2_VERTEX_4 If enabled , calls to glEvalCoord2 , glEvalMesh2 , and glEvalPoint2 generate homogeneous x , y , z , and w vertex coordi- nates. See glMap2.;
#P window linecount 4;
#P comment 49 -1454 373 196618 GL_MINMAX If enabled , compute the minimum and maximum values of incoming RGBA color values. See glMinmax. GL_NORMALIZE If enabled , normal vectors speci- fied with glNormal are scaled to unit length after transformation. See glNormal.;
#P window linecount 5;
#P comment 48 -1322 373 196618 GL_POINT_SMOOTH If enabled , draw points with proper filtering. Otherwise , draw aliased points. See glPointSize. GL_POLYGON_OFFSET_FILL If enabled , and if the polygon is rendered in GL_FILL mode , an off- set is added to depth values of a polygon’s fragments before the depth comparison is performed. See glPolygonOffset.;
#P window linecount 6;
#P comment 49 -1144 373 196618 GL_POLYGON_OFFSET_LINE If enabled , and if the polygon is rendered in GL_LINE mode , an off- set is added to depth values of a polygon’s fragments before the depth comparison is performed. See glPolygonOffset. GL_POLYGON_OFFSET_POINT If enabled , an offset is added to depth values of a polygon’s frag- ments before the depth comparison is performed , if the polygon is rendered in GL_POINT mode. See glPolygonOffset.;
#P window linecount 5;
#P comment 50 -936 370 196618 GL_POLYGON_SMOOTH If enabled , draw polygons with proper filtering. Otherwise , draw aliased polygons. For cor- rect anti-aliased polygons , an alpha buffer is needed and the polygons must be sorted front to back. GL_POLYGON_STIPPLE If enabled , use the current poly- gon stipple pattern when render- ing polygons. See glPolygonStipple.;
#P comment 49 -748 370 196618 GL_POST_COLOR_MATRIX_COLOR_TABLE If enabled , preform a color table lookup on RGBA color values after color matrix transformation. See glColorTable. GL_POST_CONVOLUTION_COLOR_TABLE If enabled , preform a color table lookup on RGBA color values after convolution. See glColorTable.;
#P comment 49 -583 370 196618 GL_RESCALE_NORMAL If enabled , normal vectors speci- fied with glNormal are scaled to unit length after transformation. See glNormal. GL_SEPARABLE_2D If enabled , perform a two-dimen- sional convolution operation using a separable convolution filter on incoming RGBA color values. See glSeparableFilter2D.;
#P window linecount 3;
#P comment 48 -420 370 196618 GL_SCISSOR_TEST If enabled , discard fragments that are outside the scissor rectangle. See glScissor. GL_STENCIL_TEST If enabled , do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp.;
#P window linecount 5;
#P comment 48 -292 370 196618 GL_TEXTURE_1D If enabled , one-dimensional tex- turing is performed (unless two- or three-dimensional texturing is also enabled). See glTexImage1D. GL_TEXTURE_2D If enabled , two-dimensional tex- turing is performed (unless three-dimensional texturing is also enabled). See glTexImage2D.;
#P comment 45 -150 370 196618 GL_TEXTURE_3D If enabled , three-dimensional texturing is performed. See glTexImage3D. GL_TEXTURE_GEN_Q If enabled , the q texture coordi- nate is computed using the tex- ture generation function defined with glTexGen. Otherwise , the current q texture coordinate is used. See glTexGen.;
#P window linecount 3;
#P comment 44 10 370 196618 GL_TEXTURE_GEN_R If enabled , the r texture coordi- nate is computed using the tex- ture generation function defined with glTexGen. Otherwise , the current r texture coordinate is used. See glTexGen.;
#P comment 43 112 370 196618 GL_TEXTURE_GEN_S If enabled , the s texture coordi- nate is computed using the tex- ture generation function defined with glTexGen. Otherwise , the current s texture coordinate is used. See glTexGen.;
#P comment 42 211 370 196618 GL_TEXTURE_GEN_T If enabled , the t texture coordi- nate is computed using the tex- ture generation function defined with glTexGen. Otherwise , the current t texture coordinate is used. See glTexGen.;
#P window linecount 5;
#P comment 43 311 370 196618 NOTES GL_POLYGON_OFFSET_FILL , GL_POLYGON_OFFSET_LINE , GL_POLYGON_OFFSET_POINT , GL_COLOR_LOGIC_OP , and GL_INDEX_LOGIC_OP are available only if the GL version is 1.1 or greater. GL_RESCALE_NORMAL , and GL_TEXTURE_3D are available only if the GL version is 1.2 or greater.;
#P comment 43 441 370 196618 GL_COLOR_TABLE , GL_CONVOLUTION_1D , GL_CONVOLUTION_2D , GL_HISTOGRAM , GL_MINMAX , GL_POST_COLOR_MATRIX_COLOR_TABLE , GL_POST_CONVOLUTION_COLOR_TABLE , and GL_SEPARABLE_2D are available only if GL_ARB_imaging is returned from glGet with an argument of GL_EXTENSIONS.;
#P comment 42 553 370 196618 If GL_ARB_multitexture is supported , GL_TEXTURE_1D , GL_TEXTURE_2D , GL_TEXTURE_3D , GL_TEXTURE_GEN_S , GL_TEXTURE_GEN_T , GL_TEXTURE_GEN_R , and GL_TEXTURE_GEN_Q enable or disable the respective state for the active tex- ture unit specified with glActiveTextureARB.;
#P window linecount 1;
#P comment 47 -4306 100 196618 Description;
#P pop;
#P newobj 408 233 121 196618 p enable_more_details;
#P window setfont "Sans Serif" 9.;
#P newex 216 134 136 196617 DGLEnable GL_CLIP_PLANE0;
#P newex 23 135 175 196617 DGLMaterial GL_FRONT GL_AMBIENT;
#P newex 217 298 137 196617 DGLUTSolidSphere 60 10 10;
#P window linecount 0;
#P newex 217 197 73 196617 DGLPopMatrix;
#P newex 217 72 78 196617 DGLPushMatrix;
#P newex 217 113 126 196617 DGLEnable GL_CULL_FACE;
#P newex 217 176 70 196617 DGLPopAttrib;
#P newex 217 155 103 196617 DGLUTSolidCube 160;
#P outlet 217 338 15 0;
#P inlet 217 32 15 0;
#P comment 407 113 176 196617 What I need to do here is remove the front of the Cube (leaving 5 faces) so I can see the sphere inside. I’m not sure whether I should be culling a face or clipping a plane and in what order.;
#P user panel 14 64 382 190;
#X brgb 255 255 255;
#X frgb 248 82 0;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 6 0 11 0;
#P connect 2 0 7 0;
#P connect 7 0 15 0;
#P connect 15 0 6 0;
#P connect 11 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 3 0;
#P pop;
#P newobj 82 744 43 196617 p scene;
#P comment 184 540 13 196617 z;
#P comment 148 540 14 196617 y;
#P comment 112 540 14 196617 x;
#P flonum 184 555 53 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 148 555 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 112 555 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 575 117 196617 DGLTranslate 0. 0. -30.;
#P number 97 681 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 205 666 13 196617 z;
#P comment 169 666 14 196617 y;
#P comment 133 666 14 196617 x;
#P flonum 205 681 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 169 681 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 133 681 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 703 101 196617 DGLRotate 0 0. 0. 0.;
#P comment 96 666 33 196617 angle;
#P number 97 619 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 205 604 13 196617 z;
#P comment 169 604 14 196617 y;
#P comment 133 604 14 196617 x;
#P flonum 205 619 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 169 619 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 133 619 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 641 101 196617 DGLRotate 0 1. 1. 0.;
#P comment 96 604 33 196617 angle;
#P newex 82 774 108 196617 DIPSSwapBuffer main;
#P newex 82 153 82 196617 DGLLoadIdentity;
#P newex 82 92 139 196617 DIPSSetCurrentWindow main;
#P window setfont "Sans Serif" 18.;
#P comment 128 738 144 196626 The 3D scene;
#B frgb 255 9 9;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 308 374 134 196617 Lighting , all controlling light zero (GL_LGHT0 < - zero);
#P toggle 82 8 15 0;
#P window linecount 1;
#P newex 282 8 167 196617 DIPSWindow main 20 360 640 480;
#N vpatcher 589 94 973 532;
#P origin 16 0;
#P window setfont "Sans Serif" 9.;
#P newex 43 248 105 196617 DGLEnable GL_LIGHT0;
#P newex 43 228 115 196617 DGLEnable GL_LIGHTING;
#P newex 43 207 110 196617 DGLClearColor 0. 0. 0.;
#P newex 43 349 146 196617 DGLEnable GL_POINT_SMOOTH;
#P newex 43 329 138 196617 DGLEnable GL_LINE_SMOOTH;
#P newex 43 309 103 196617 DGLEnable GL_BLEND;
#P newex 43 289 279 196617 DGLBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA;
#P newex 43 269 78 196617 DGLPointSize 2;
#P newex 43 163 189 196617 DGLUPerspective 45 1.3333 0.01 1000;
#P newex 43 185 152 196617 DGLMatrixMode GL_MODELVIEW;
#P newex 43 141 81 196617 DGLLoadIdentity;
#P newex 43 118 155 196617 DGLMatrixMode GL_PROJECTION;
#P inlet 43 27 15 0;
#P newex 43 96 139 196617 DIPSSetCurrentWindow main;
#P newex 43 74 31 196617 sel 1;
#P comment 79 77 128 196617 On start setup;
#P connect 3 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P pop;
#P newobj 180 62 80 196617 p texturemaker;
#P newex 82 41 108 196617 t i i;
#P newex 82 62 52 196617 metro 30;
#P user panel 65 536 382 190;
#X brgb 255 255 255;
#X frgb 165 165 165;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 65 179 382 227;
#X brgb 255 255 255;
#X frgb 165 165 165;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 65 424 382 94;
#X brgb 255 255 255;
#X frgb 165 165 165;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 7 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 10 0;
#P connect 10 0 92 0;
#P connect 92 0 93 0;
#P connect 93 0 11 0;
#P connect 11 0 58 0;
#P connect 58 0 59 0;
#P connect 59 0 73 0;
#P connect 73 0 81 0;
#P connect 81 0 42 0;
#P connect 42 0 31 0;
#P connect 31 0 14 0;
#P connect 14 0 23 0;
#P connect 23 0 38 0;
#P connect 38 0 12 0;
#P connect 12 0 57 0;
#P connect 43 0 42 1;
#P connect 21 0 14 1;
#P connect 30 0 23 1;
#P connect 32 0 31 1;
#P connect 44 0 42 2;
#P connect 15 0 14 2;
#P connect 24 0 23 2;
#P connect 66 0 59 1;
#P connect 74 0 73 1;
#P connect 82 0 81 1;
#P connect 45 0 42 3;
#P connect 16 0 14 3;
#P connect 25 0 23 3;
#P connect 33 0 31 2;
#P connect 46 0 42 4;
#P connect 17 0 14 4;
#P connect 26 0 23 4;
#P connect 47 0 42 5;
#P connect 67 0 59 2;
#P connect 4 1 5 0;
#P connect 75 0 73 2;
#P connect 60 0 58 2;
#P connect 34 0 31 3;
#P connect 83 0 81 2;
#P connect 48 0 42 6;
#P connect 68 0 59 3;
#P connect 76 0 73 3;
#P connect 61 0 58 3;
#P connect 84 0 81 3;
#P connect 72 0 59 4;
#P connect 80 0 73 4;
#P connect 62 0 58 4;
#P connect 88 0 81 4;
#P pop;


September 1, 2009 | 7:42 pm

no idea about how DIPS works, but in opengl, you can visually remove the face of a cube by turning on culling. either back-face culling or front-face culling, depending on the winding of the vertices of the cube face (or the whole cube mesh).

generally, if it’a a single cube mesh (and not 6 planes positioned as a cube), then you would turn on front-face culling to be able to see through one of the cubes front/outer faces, inside the cube (the back faces are the "inner" faces, and they will remain visible).


September 1, 2009 | 7:51 pm

So it’s face culling rather than clipping. I’ll have another play with this now that I know which of the two I should be using. IS there anything else such as lighting or material in gl which could cancel out the face culling?

a+
gar


Viewing 3 posts - 1 through 3 (of 3 total)