So, here is the link to the code in C ++ http://pastebin.com/nfPmd0um (with Polish comments;) I would like to make a sphere divided into four planes. Each part of the sphere must have a different color. At the moment, it displays only 2 colored parts. I know that something is wrong with this part of the code in the Display () function:
glEnable (GL_CLIP_PLANE0 +i); glDisable (GL_CLIP_PLANE1 -i); glEnable (GL_CLIP_PLANE2 +i); glDisable (GL_CLIP_PLANE3 -i);
Does anyone know what I have to change? Thanks in advance:)
Why are you using + i in your glEnable / Disable call. This means that after I increase to 1, you modify the planes above the index (GL_CLIP_PLANE3), and you do not have the planes defined there.
, "i" glEnable/Disable - (mod (i, 4) == i% 4).
. , :
glEnable (GL_CLIP_PLANE0 +i ); glDisable (GL_CLIP_PLANE0 + (1+4-i)%4); glEnable (GL_CLIP_PLANE0 +(2+i)%4); glDisable (GL_CLIP_PLANE0 +(3+4-i)%4);
, (1 + 4-i)% 4 1 0 3 2, 0 1 2 3. 3 2 1 0.
Source: https://habr.com/ru/post/1747274/More articles:Regular expression to remove start and end characters from a string? - phphelp me understand that the following javascript is related to managing AsyncFileUpload - asp.netHow to make meld preferable to SVN-diff over CVS diff - svnGetting node with attributes from SelectSingleNode - c #Можно ли использовать Spread Toolkit на Amazon EC2? - architectureКак отключить сообщения статического анализа Xcode (Clang)? - xcodehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1747276/using-a-preparedstatement-to-persist-an-array-of-java-enums-to-an-array-of-postgres-enums&usg=ALkJrhicuLIl036ZG_6yn9vtz_rJ21G_NQWhat considerations need to be considered when switching an application to support? - c #How to Calibrate Mac Monitor for iPhone Design - iphoneUML Script Example - language-agnosticAll Articles