setVertexOptimization

Started by msp-1, June 27, 2011, 05:27:24 PM

Previous topic - Next topic

msp-1

Hello,
I have a question about setVertexOptimization.


This cube is separated into 6 faces in blender.
I tried to load this cube without vertexoptimization. (setVertexOptimization(false))

In my expectation, it become like a FLAT SHADING.
Which has sharp edges.
But shading result is not.
(Maybe shading result is not change by using vertexoptimization.)

How should I use setVertexOptimization?

EgonOlsen

This setting has no influence on normal generation, because that's solely based on vertex positions in object space, not if they are shared or not. However, if you need different normals and vertices are not shared, you can tweak them afterwards by using the PolygonManager. If all you need is flat shading, you can try to call Object3D.setShadingMode(...).

msp-1

Thank you for your quick response!

I tried to use setShadingMode();
It's also very useful function.
But I want to make a object which has flat and smooth both type faces.
Then, next I want to try PolygonManager.

Should I use getTransformedNormal() function?
Could you tell me a example of using PolygonManager?

EgonOlsen

My bad...i didn't mean the PolygonManager but an implementation of the IVertexController to tweak the normals. You can simply extend the GenericVertexController and set new normals with that.