Reputation: 1653
I have downloaded the sample ARCore project using JAVA and OPENGL. I have gone thru the code, and I can't find out why the planes are changing colours. Is this a default thing. How do I disable it?
Upvotes: 0
Views: 291
Reputation: 5007
It happens when setting the shader variables in PlaneRenderer.java:
int colorIndex = planeIndex % PLANE_COLORS_RGBA.length;
colorRgbaToFloat(mPlaneColor, PLANE_COLORS_RGBA[colorIndex]);
GLES20.glUniform4fv(mLineColorUniform, 1, mPlaneColor, 0);
GLES20.glUniform4fv(mDotColorUniform, 1, mPlaneColor, 0);
So the easiest/quickest modification would be to set the color index to a constant value
Upvotes: 3