By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Converting from arraylists to multi-dimensional arrays

P: n/a
I see that variations on this question have appeared before but I'm still completely stumped.

I'm developing an application with a fairly robust graphics component for 3D rendering. I've written all the 3D rendering scripts, but what's really hanging me up is how to I pass information from an one-dimensional arraylist to a two-dimensional array. Here's what I'm trying to do:

1) My program generates an arraylist called "mpoints" of 2D Points based on mouse-clicks, saving the x- and y-coordinate data.

2) I pass those "mpoints" values to another procedure which creates a user-defined class object called "Elevation". In creating that new object, the 2D points values from the "mpoints" arraylist are redefined as 3D points by adding a z-coordinate.

3) What I wind up with is an arraylist of 3D points called "melevationpoints"

All of that works fine. Where I run into trouble, however, is trying to pass the values from the one-dimensional arraylist "melevationspoints" into the following multi-dimensional array:

Dim pointsarray(,) as Double

For my code to work properly, the result should look something like this:

Dim pointsarray(,) as double = {{23,24,0}, {45,33,0}}

I do not have a lot of experience on working with multi-dimensional arrays so I'm not getting very far. I do have a lot of experience with arraylists, but I can't seem to solve this problem.

Any ideas?

--
James
--
James
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.