Jump to content
  • Advertisement

Archived

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

norleaf

question: different dimensional arrays?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, hope this isn´t the wrong place... then plz point me in the right direction... I wonder if I can take a simple layer out of an 3 dimensional array and store it in a 2d array... I have no idea what the code should look like unless I copy one number at a time... something like : my2dArray[x][y] = my3dArray[x][y][3]; but this works only if inside two for-loops running through numbers x and y... but isn´t there any smarter solution?] [edited by - norleaf on October 12, 2003 11:33:14 AM]

Share this post


Link to post
Share on other sites
Advertisement
using Array3D[128][128][128] - to get a 128x128 slice do:

memcpy(Array3D[slicex], Array2D, 128x128);



[ My Site ]
''I wish life was not so short,'' he thought. ''Languages take such a time, and so do all the things one wants to know about.'' - J.R.R Tolkien
/*ilici*/

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!