Ordering arrays?

Topics concerning ICE & Math
Post Reply
Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Ordering arrays?

Post by Bullit » 27 Jan 2014, 17:31

Hope this is not a stupid question. I am dwelving now more seriously in maths and came up this question, how an array in ice is ordered by default? Say point positions.

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Ordering arrays?

Post by Pooby » 27 Jan 2014, 18:27

Point positions aren't 'arrays' in ICE they are simply a per-point attribute, so each point contains one value. Ie, its own point position. An example of an array would be if you got the positions of each points neighbours, in which case each point would hold an array of ,say 4 values.

If you want to convert the point positions into a Per-object context array, then I think they are ordered by Vertex ID, but you dont typically need or want to do that.

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Ordering arrays?

Post by Bullit » 28 Jan 2014, 11:22

So point positions of a sphere couldn't be considered an array?

Also you said that the point position is only one value. But isn't 3 values (x,y,z)?

If you want to convert the point positions into a Per-object context array, then I think they are ordered by Vertex ID
Makes sense. But with Sort Array can i change the order for example by the y value ?

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: Ordering arrays?

Post by Pooby » 28 Jan 2014, 11:32

I consider a vector to still be one value, but yes, depending on how you look at it, it could be considered to be made from 3 values.

You can change the order of any array with 'sort array with key'

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Ordering arrays?

Post by Daniel Brassard » 28 Jan 2014, 14:31

I am not sure about the internal data structure of Softimage but it definitively store information about vertices, edges and faces in various arrays.

The first array is the array of vertices that compose the object. Each vertex is composed of three component: X, Y and Z so vertex0 contain x0, y0, z0, vertex 1 contain x1, y1, z1, and so on. For a cube with 8 vertices you would therefore have an array of 8x3 =24 elements in this array. The point position is an index pointer to this array. It seek say the point at index1 and return the 3 element (x,y,z) that are linked to vertex1 in the array.

The edge array most likely store the vertex index that describe the edge say for edge0 ( Vertex0, Vertex1)

The face array most likely store the vertex index in clockwise or counterclockwise order that compose the face: for a quad say face0 (vertex0, vertex1, vertex3, vertex2 ...)

Depending of the internal data structure there are other thing stored as well in arrays and methods to access these that relate to polygons count (number of vertices that compose a face), neightboring vertices, edges or faces, normals, texture and so on. ICE give you access to some of these arrays.

CMeshBuilder example shows you some of the arrays used by Softimage to create a polymesh.

http://download.autodesk.com/global/doc ... ilder.html

Hope that help.
$ifndef "Softimage"
set "Softimage" "true"
$endif

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Ordering arrays?

Post by Bullit » 28 Jan 2014, 16:15

Thanks. This is just me trying to understand about arrays and how to use them in ICE. For example from an array of points or vertex get the top most in Y or in Z or in X.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests