face normal / phong normal [CLOSED]
-
On 18/08/2015 at 13:11, xxxxxxxx wrote:
hi there,
i'm currently scripting a spline that behaves like a light ray. so it will reflect or refract (according to its ior) when it hits objects. actually it's based on a script by krotMonster (
). so far it's is working fine already.now, when you have a bent surface and a ray moves from one polygon to another, the reflected ray will jump in its new direction. not so elegant. so i wanted to use the phong normals to smoothen this transition between the polygons. in the sdk you have the ability to ask for the face normal – intersect["f_normal"] – or the phong normal – intersect["s_normal"]. but when i read out the values they are always the same.
does somebody know what might be the problem? am i misunderstanding these commands? is it a bug?
would be nice to get it working ... will share the script when it's done ...sebastian
-
On 19/08/2015 at 09:40, xxxxxxxx wrote:
Hi,
welcome to the Plugin Café forums
I think, our member glenn already did something like this. It was discussed in this thread.
Regarding your question, can you provide us with a bit of code, so we have something to work on? -
On 24/08/2015 at 16:39, xxxxxxxx wrote:
hi again,
glenns thread looks interesting. will check it out.sure you can have some code to work on. you can download my test scene:
http://www.datamilch.de/download/ray_bounce_refract_2.c4d.zipthe main question is why
ray_result["f_normal"].GetNormalized()
ray_result["s_normal"].GetNormalized()
return the same value.shouldn't "s_normal" be different when the ray hits a face that is smoothed by a phong tag?
-
On 26/08/2015 at 04:01, xxxxxxxx wrote:
Bad news, this was a planned feature and never made it in.
You only get the face normal. Phong normal currently contains a copy of the face normal.
The documentation will be updated accordingly. -
On 26/08/2015 at 06:13, xxxxxxxx wrote:
thanks andreas.
at least it's good to know.so if i still wanted to solve this, are you able to give an estimate how hard it would be to calculate the phong normal. would it be possible in 10 lines of clever code or more like 200?
i suppose one would need the normals of the neighboring faces and a value how near the ray is to a face border. sounds like this will be no fun to do.