News:

 

Topic: Tool/Function > normal direction problem (My Error)  (Read 9397 times)

0 Members and 1 Guest are viewing this topic.

  • No avatar
  • Posts: 2102
  • Polygon
October 18, 2012, 01:28:48 pm
Hello IStonia,

Quick example.

Created a Box. Move one side face down in Y, added 2 edge loops and selected the created polygons:-



Using any of the tools/function that use normal direction (such as "local move > normal", or "Extrude > vertex normal") give incorrect results.

Here I have used "[sub_object polygon]streamline tool(A) > Polygon_extrude_polygonNormal#" with incorrect result.



This is expected result:-



Thanks,




« Last Edit: October 22, 2012, 02:09:03 pm by steve »

  • No avatar
  • Posts: 3716
  • Developer
  • Administrator
  • Polygon
October 22, 2012, 08:50:21 am
Your should use the visual polygon extrude tool with 'In vertex normals' option. Before your extrude, press down X key. You can read this information in the help file. Without X key down, the program will compute normal only from selected polygons. When the program computes vertex normal, polygon angles at that vertex are taken into account. That's why you have different extrusion directions between the lower part and the upper part.

  • Posts: 424
  • Triangle
    • Reiner`s Tilesets
October 22, 2012, 09:48:54 am
Wouldn`t it be better to make the expected result as the default method? :)
Free Gamegraphics, Freeware Games http//www.reinerstilesets.de

  • No avatar
  • Posts: 2102
  • Polygon
October 22, 2012, 09:50:53 am
Ah, right. I had missed that in the help file. Thank you.
The "X" key option also works on the Basic streamline tool.

While checking the different results on a sphere with quad caps, using the "Extrude > vertex normals" with or without the "X" key option, there is an error(see pic). Is that a problem with the extrude or with the sphere?





  • No avatar
  • Posts: 3716
  • Developer
  • Administrator
  • Polygon
October 22, 2012, 11:51:26 am
Wouldn`t it be better to make the expected result as the default method? :)

Not sure about that. I cant determine which case is more common.

Ah, right. I had missed that in the help file. Thank you.
The "X" key option also works on the Basic streamline tool.

While checking the different results on a sphere with quad caps, using the "Extrude > vertex normals" with or without the "X" key option, there is an error(see pic). Is that a problem with the extrude or with the sphere?

It is about the normal computation method. The winding of the polygon affects it. I will see if I can find a better way.

  • No avatar
  • Posts: 2102
  • Polygon
October 22, 2012, 02:06:59 pm
The winding of the polygon affects it.
Right thanks, I did not think to check the winding.


 
Quote
I will see if I can find a better way.
It is not a problem for me now I know what to check for, and can easily correct.


  • No avatar
  • Posts: 2102
  • Polygon
October 22, 2012, 05:26:48 pm
Hi IStonia,

Without X key down, the program will compute normal only from selected polygons. When the program computes vertex normal, polygon angles at that vertex are taken into account. That's why you have different extrusion directions between the lower part and the upper part.

I am just trying to get a better understanding (and the logic) of that.

From what I am seeing, (from my first example) is that the vertex normal directions are being calculated as if a single "smooth group" as been applied. I am also seeing, that if I measure the distances along the vertex direction extrudes, they are not consistent.

When calculating the normal directions, should the directions not be based on an average of the vertex normal directions of the individual polygon vertex normals, as if they had no smooth group applied across their boundaries?




  • No avatar
  • Posts: 3716
  • Developer
  • Administrator
  • Polygon
October 23, 2012, 05:06:00 am
I just cosider to remove angle factor from the computation. It doesn't seem very usefull at all. If I did that, you will get the expected result without pressing X key.

Taking smooth groups into account just makes things complicated, imho.

  • No avatar
  • Posts: 3716
  • Developer
  • Administrator
  • Polygon
October 23, 2012, 08:50:28 am
Ok, all fixed. I have removed the angle factor and also taken smooth groups into account.

  • No avatar
  • Posts: 2102
  • Polygon
October 23, 2012, 01:25:29 pm
I think that is now excellent.
I am getting what I expect from the standard extrude and from the extrude with "X"(taking into account surrounding geometry).
The shell function now also gives me expected results on all shapes/surfaces I have checked.

Thank you very much for looking more at this and for taking the time to make the changes.

Best Regards,

-Steve