#### Archived

This topic is now archived and is closed to further replies.

# Help with arrays.

This topic is 6255 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, say for example you have a cube and you divide each cube into different sections, or into smaller cubes. Each small cube can start off the same color, is it possible to figure out which array element the block is, for example... say i have something like this int front[4][1]= {{RED},{RED},{RED},{RED}}; that just says the front of the cube has for smaller squares in it. And each starts off red, how can i find out which element is which when it is displayed on the screen, I want to do some translations with it using opengl, the translations aren''t a problem, I just need to figure out which one to translate, if this isn''t stated clear enough i will try and make it more clear if someone asks. Thanks in advance.

##### Share on other sites
explain a little better... I''m not shure that I''m getting what you mean by finding it... do you mean mouse click to the poloygon or what?

##### Share on other sites
OK, i''m not talking about mouse clicks or anything, i just want to find the location in the array that each piece is, like i want to know which block is the upper left hand cube in the array. If it''s [2][1] or whatever, i just want to know how i can figure this out.

##### Share on other sites
Your array looks more like a line than a cube, since it''s [4][1].
I''d imagine that the lower elements are, the farther to the upper left. Does that sound sound right?

-Forcas

"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 19
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632664
• Total Posts
3007708
• ### Who's Online (See full list)

There are no registered users currently online

×