User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Dimensions in binary array

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dimensions in binary array

    Hello, does anyone know how to write in x/y/x dimensions using the binary array object? Maybe a certain syntax to input the coordinates?

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    Binary Arrays are 1-dimensional arrays. If you want more dimensions, you'll have to simulate them yourself.
    The easiest way is probably to use the Array 3D extension (not that it's hard to code without).

    To be perfectly honest, you may as well just use a normal array - the filesize is unlikely to be a problem, and nor is the lack of encryption.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    If you want to convert/simulate a 3D array within a 1D array, it works like this:

    Z * width * height + X * height + Y

    Think of it like a cube. It's Length * Width * Height. Z is how deep you want to go, X is how far left/right, Y is how far up down.

    If that makes sense.

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    Thank you both. RickyRombo your expression seems to be what I was looking for.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    Though you tend to actually use:
    Z * width * height + Y * width + X
    (which stores the data row by row, Ricky's is column by column).

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    But of course, that's not going to be much use without a way to convert back to 3d coordinates...

    3d to 1d:
    i = (z * dimX * dimY) + (y * dim + x

    1d to 3d:
    x = i mod dimX
    y = i mod (dimX * dimY) / dimX
    z = i / (dimX * dimY)

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    I'm a more "up-down" guy, I guess

  8. #8
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    Quote Originally Posted by MuddyMole
    But of course, that's not going to be much use without a way to convert back to 3d coordinates...

    3d to 1d:
    i = (z * dimX * dimY) + (y * dim + x

    1d to 3d:
    x = i mod dimX
    y = i mod (dimX * dimY) / dimX
    z = i / (dimX * dimY)
    Better is:
    x = i mod dimX
    y = floor(i / dim mod dimY
    z = floor(i / (dimX * dimY))

  9. #9
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    No, not "better" - just different :P

  10. #10
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Dimensions in binary array

    Since the OP was asking about Binary Array in particular - there is an expression to convert X/Y/Z coordinates to a single X coordinate.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Array and dimensions.
    By Aasland in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th April 2012, 05:26 AM
  2. How fast is Array object in massive dimensions? (thousands x thousands)
    By Tsun in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st November 2011, 12:16 PM
  3. Dynamic Array to Binary Array problems
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd March 2010, 10:48 PM
  4. Binary Array
    By astrospoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 9th September 2008, 03:34 AM
  5. Binary Array
    By xerus in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 7th March 2008, 05:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •