Jump to content
  • Advertisement


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


question: different dimensional arrays?

This topic is 5364 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
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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!