THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2009 at 14:19, xxxxxxxx wrote:
Cinema 4D Version: 10.1
Platform: Windows ; Mac ;
Language(s) : C++ ;
using barycentric coordinates, I get random positions on the polygons of an object. Now I'd like to get the Phong normals for all these positions.
I know, I can use CreatePhongnormals to get the Phong normals of all polygons, but that only gives me one Phong normal for each polygon, right? So how can I get a nice normal for every position *on* a polygon?
Thanks for any help
On 02/01/2009 at 19:44, xxxxxxxx wrote:
The CreatePhongNormals() function gives you an array of the normals at each point of each polygon (4*GetPolygonCount()). You use this along with the barycentric coordinates to interpolate the normal at the point on each triangular part of a quad.
For the interpolated phong normal at a given point on a triangle I use this:
> \> phongN = !(vertNormA \* bryCrd.x + vertNormB \* bryCrd.y + vertNormC \* bryCrd.z); \>
\> phongN = !(vertNormA \* bryCrd.x + vertNormB \* bryCrd.y + vertNormC \* bryCrd.z); \>
On 03/01/2009 at 03:38, xxxxxxxx wrote:
Ah! Great! Thanks again, Dan!
Now I can do what I want