SetSmoothMode / SetSmoothAngle methods

Question and answer about Polygon Cruncher SDK
Post Reply
Site Admin
Posts: 282
Joined: Thu Jul 05, 2007 11:06 am

SetSmoothMode / SetSmoothAngle methods

Post by mootools » Tue Apr 04, 2017 7:46 am

C3DGeomObject class contains several methods on the way to control auto generated normals to be generated.

Code: Select all

	void SetSmoothAngle(float angle);
	float GetSmoothAngle(bool *globalAngle = NULL) const;
	void SetSmoothMode(NormalSmoothMode mode);
	NormalSmoothMode GetSmoothMode(bool *globalMode = NULL) const;
void SetSmoothAngle(float radianAngle) :
Set the smooth angle for the specific object. It is used, for example, when calling GetPointNormalChannel() to generate normal breaks.

float GetSmoothAngle(bool *globalRadianAngle = NULL) const;
Get the smooth angle in radian. If object has no specific angle, it will return the C3DScene::GetSmoothAngle. globalRadianAngle, if provided, is set to true, if the object used the global scene smooth angle.

void SetSmoothMode(NormalSmoothMode mode);
Set way normals are generated. Cf. NormalSmoothMode to learn more about the differences.

NormalSmoothMode GetSmoothMode(bool *globalMode = NULL) const;
Get the smooth method used for the object. If object has no specific method, it will return the C3DScene::GetSmoothMode. globalMode, if provided, is set to true, if the object used the global normal mode.

All these methods does not generates normals, they only predefined the way point normals are generated.
To generates point normals, use CPointNormalChannel *C3DGeomObject::GetPointNormalChannel()
You then get a normal channels that defines one or more normals per point. A point has several normals if it is on a normal break.
The lower is the angle provided to SetSmoothAngle the more you'll get normal breaks.

CFaceNormalChannel *C3DGeomObject::GetFaceNormalChannel() generates face normal, which means that each face has a single normal.
This could be used for facet rendering.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest