How to transform gameObjects in array? [closed]

I have an array of available gameObjects in the scene. An array of GO should be transformed according to received floats through UDP connection. I know it is simple, but can't figure it out how to accomplish the transformation an array of GO according to received unique floats for each GO, any help will be appreciated.

Here is a transformation floats, it might be helpful I guess:

``````x =ReadSingleBigEndian(data, signalOffset);
signalOffset+=4;
signalOffset+=4;
signalOffset+=4;
signalOffset+=4;
signalOffset+=4;
signalOffset+=4;
``````

Gathering information:

All I need to do is transform an array of game objects, of course I need to use some kind of loop, but the problem is I have an array of the float values divided by offset and array of the game objects and I need to transform them by assigning float values which came through udp and each of the floats is unique and belongs to exact game object.

-
 I'm having trouble understanding what your asking here. Maybe you just need to loop over your array of game objects? Try to add some more details if you really want an answer. – Laurent Couvidou Nov 21 '12 at 14:00 You need to find documents of a matrix library. There should be methods having name like setRotationMatrix or perhaps with keywords Euler angles, which should consume greek alphabets and a 'translate' method, that consumes the x,y,z. – Aki Suihkonen Nov 21 '12 at 14:06 @LaurentCouvidou, what exactly you didn't understand and what details do you need to understand my question? – user1764781 Nov 21 '12 at 14:53 @AkiSuihkonen, are you familiar with the Unity3D? – user1764781 Nov 21 '12 at 14:53 @LaurentCouvidou, what do you mean by "loop over your array of game objects" ? – user1764781 Nov 21 '12 at 14:55

closed as not a real question by Laurent Couvidou, Jonathan Hobbs, Josh Petrie, Trevor Powell, bummzackDec 16 '12 at 13:10

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

In Unity3d it seems that Components contain their own modelview matrices, which are then modified with

``````object.Transform.Rotate(alpha,theta,phi); // and translated / moved around with
object.Transform.Translate(x,y,z).
``````

Also Unity3D maintains hierarchical model of components:

in conceptual level (or pseudo Object Oriented Language) one makes e.g.

``````parent = new Component();
parent.add (array_of_children);    // dont know the actual syntax -
parent.Transform.Translate(x,y,z); // shifts all the children also
parent.array_of_children[7].Transform.Rotate(alpha,phi,theta); // rotate only this one
``````

One should still consult a game / graphics programming tutorial with introduction to matrices.

-
 actually the x,y,z and alpha, theta, phi are not fixed values, they can be x_2,y_2,z_2 and alpha_2, theta_2, phi_2 ... x_n,y_n,z_n and alpha_n, theta_n, phi_n – user1764781 Nov 21 '12 at 15:25 according to the x,y,z and alpha, theta, phi; x_2,y_2,z_2 and alpha_2, theta_2, phi_2 ... x_n,y_n,z_n and alpha_n, theta_n, phi_n I need to transform: public static List GameObjects = new List(); – user1764781 Nov 21 '12 at 15:27

If the issue is that value x is sent, and it is only valid for object y in the array, but at runtime you wouldn't be able to known which one is y. (it is JUST sending a float)

Then I think the issue is how the value is being sent. You really can't just sent a float. You would need to send a key pair or something. So when value x gets sent it has "name=object 2; value=5.7;" or something simmaler.

-