# Change Point Order [SOLVED]

On 03/02/2017 at 04:26, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R18
Platform:   Windows  ;
Language(s) :     C++  ;

---------
Hey,

I am trying to figure out what exactly Change Point Order command does behind the scenes.
Does it only switch the order of points in every selected poly clock-wise or counter clock-wise?
It seems I get different results depending on the selected polys.

I need to understand the algorithm behind the command because I am trying to compute tangent vectors from uv's and positions and I only ever get correct results if I reorder the points first.

I would appreciate any insight in this topic.

On 06/02/2017 at 06:57, xxxxxxxx wrote:

Hi Grosnus, thanks for writing us.

With reference to your request, although we are not allowed to disclose any algorithm or describe procedures internally used in Cinema the command you're referring doesn't change the order of the points describing a polygon (from CW to CCW or viceversa) but simply changes the sequence the points are representing a polygon
Consider a triangle namely having points at

-50,0,50
0,0,50
50,0,-50

and the only polygon describing it using the following indexes representation

a:0 b:1 c:2

Running the command once will result in having the polygon/points index representation swapped of one position:

a:1 b:2 c:0

whilst running twice will result having the polygon/points index representation swapped of two positions:

a:2 b:0 c:1

Running a third time will result in a polygon/points representation equal to the initial set.

As you can see the index will still refer to CCW order whilst the first value "a" will cycles between 0, 1 and 2.

Hoping it helps to sort out your doubts, feel free to comment further if something is still unclear.

Best, R.