jPCT-AE - a 3d engine for Android > Support

setAdditionalColor

(1/2) > >>

Alexey:
Hello, i try to set additional color for the object, but it not do any color changes. May do something wrong?

--- Code: ---Object3dEx marker = new Object3dEx(Primitives.getPlane(1, 10));
initTextureByName(UITextureName.marker.name(), true);
marker.setBillboarding(true);
marker.setTransparency(5);
marker.setTexture(UITextureName.marker.name());
marker.compile();
marker.setLighting(Object3D.LIGHTING_NO_LIGHTS);
marker.build();
world.addObject(marker);
//function for pc/android realization depend to in color class
        addAdditionalColor(marker, new int[]{0,255 ,0});
marker.translate(marker.getTranslation().calcSub(placeObj.getTransformedCenter()));
marker.addParent(placeObj);

        public void addAdditionalColor(Object3D o, int[] color){
o.setAdditionalColor(new RGBColor(color[0], color[1], color[2]));
}



--- End code ---

EgonOlsen:
Keep in mind that an additional color will multiplied with existing color (i.e. texture color), not added. This means that a red texture will stay red (at best) even if you assign blue as an additional color. Maybe that's the problem here?

Alexey:
I try on 2 objects (base color of texture - green) - to one of them add color 0,0,255 and cant see at least some difference

EgonOlsen:
How green is that green? It doesn't get greener than green, i.e. 255*255 is cut off to 255. Try with some grey or white texture instead and see what happens then.

Alexey:
Tried in empty new project - setAdditionalColor work fine, so something wrong in my project, if i find  the cause - i will write here

Navigation

[0] Message Index

[#] Next page

Go to full version