BoutCheetah

Other => Off Topic => Topic started by: Allie on October 22, 2013, 03:29:40 AM

Title: Serious question - 5000 Zylon Coins or other great reward
Post by: Allie on October 22, 2013, 03:29:40 AM
We need to translate a model 90 degrees clockwise in the x/y/z grid.
Can you find the necessary formula?

If you can find this, I will offer you 5000 Zylon Coins, or a perm version of any item in the game, or a guaranteed perm version of the halloween event rewards.
Seriously dudes, I am desperate.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: ranger234 on October 22, 2013, 04:32:10 AM
What program are you using?
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: jeroen on October 22, 2013, 04:48:40 AM
I don't really see the problem here you can open the model in a model editor and use a turn tool to change the direction it is facing?
I think that you mean that the converter changes your xyz direction, if you need a code to fix that and you want others to fix it for you, you should give more information perhaps the script type, the file type? Also a change of where the model is facing before your file is converted will fix the problem.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Allie on October 22, 2013, 05:01:57 AM
We need a formula.
Please do not question our program, it is irrelevant.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: ranger234 on October 22, 2013, 05:03:23 AM
I wanted to know because it may make it easier to understand.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Allie on October 22, 2013, 05:06:56 AM
visual studio
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rossbach on October 22, 2013, 05:37:22 AM
http://wiki.answers.com/Q/How_do_you_rotate_a_figure_90_degrees_clockwise_about_origin


Like so?  ::)
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Purple on October 22, 2013, 05:38:28 AM
Quote from: Rossbach on October 22, 2013, 05:37:22 AM
http://wiki.answers.com/Q/How_do_you_rotate_a_figure_90_degrees_clockwise_about_origin


Like so?  ::)

That's 2d.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rossbach on October 22, 2013, 06:00:10 AM
Quote from: Purple on October 22, 2013, 05:38:28 AM
Quote from: Rossbach on October 22, 2013, 05:37:22 AM
http://wiki.answers.com/Q/How_do_you_rotate_a_figure_90_degrees_clockwise_about_origin


Like so?  ::)

That's 2d.

Bleh.  ::)


(click to show/hide)
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Consume on October 22, 2013, 06:02:18 AM
Rotated 90 degrees clockwise over a specific axis, or the origin?
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: jeroen on October 22, 2013, 06:15:45 AM
it is a script for blender written in python.
I think you can add Z and Y if needed.
discussion found here: http://blenderartists.org/forum/showthread.php?255246-Rotate-whole-scene-around-x-90-and-apply-rotation
the code:
(click to show/hide)
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Iridion on October 22, 2013, 09:09:59 AM
if you are asking this in the community you are really depserate and possibly nobody knows how to do that XDXD

this works for 2d. take basics and add an axis and ur done (?)
http://support.microsoft.com/kb/80406/en-us
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: CyberSox on October 22, 2013, 09:49:42 AM
I don't know anything about models and things, but if you are asking for a formula it's possible the rotation can be done using matrices.

http://stackoverflow.com/questions/9933150/how-do-i-rotate-in-object-space-in-3d-using-matrixes (http://stackoverflow.com/questions/9933150/how-do-i-rotate-in-object-space-in-3d-using-matrixes)
http://www.fastgraph.com/makegames/3drotation/ (http://www.fastgraph.com/makegames/3drotation/)
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)




Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Purple on October 22, 2013, 10:38:34 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

I don't see where i've become Allie's 'sidekick', I was simply saying that linking a website isn't what she asked for. I already linked her that website and pointed that out, apparently it's not what she wants. I guess I should stop going offtopic though.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: paranoia on October 22, 2013, 10:42:44 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

There are different formulas for different modeling/game languages such as python, assembly, java, c, c++, etc. There not all the same, however I do commend you on showing her the websites you have offered( considering there pretty good/useful) It probably wont help her in this situation. Allie should have posted the current axis of the model to make it much easier.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Iridion on October 22, 2013, 10:50:44 AM
Quote from: paranoia on October 22, 2013, 10:42:44 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

There are different formulas for different modeling/game languages such as python, assembly, java, c, c++, etc. There not all the same, however I do commend you on showing her the websites you have offered( considering there pretty good/useful) It probably wont help her in this situation. Allie should have posted the current axis of the model to make it much easier.


a formula is a formula

2+2 is the same thing in every language
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: droid zylon1 on October 22, 2013, 11:28:11 AM
I want be able to help until this weekend but i have the forumla's saved on my laptop at my moms. If your still in need of them then i will either post here or pm them to you. (there is 2 formula's u can use. im asuming 1 is for bc.)


http://stackoverflow.com/questions/16663647/3x3-matrix-rotation-in-c   (this is 2d but it could possibly help)


http://www.youtube.com/watch?v=PpUJsw7Y-x0   (this is a youtube video that may help rotating 3d)


Hope i helped.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: paranoia on October 22, 2013, 01:05:57 PM
Quote from: Iridion on October 22, 2013, 10:50:44 AM
Quote from: paranoia on October 22, 2013, 10:42:44 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

There are different formulas for different modeling/game languages such as python, assembly, java, c, c++, etc. There not all the same, however I do commend you on showing her the websites you have offered( considering there pretty good/useful) It probably wont help her in this situation. Allie should have posted the current axis of the model to make it much easier.


a formula is a formula

2+2 is the same thing in every language
Your not understanding that each programming language works different and reads code different.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rebuck on October 22, 2013, 01:14:32 PM
class Map extends EventEmitter
  constructor: (size) ->
    throw new Error "Size must be between 1 and 255" unless 1 < size < 255

@constant

    @size = size

    @setMaxListeners 2

@constant

initialize grid

    @grid = new Array Math.pow(@size, 3)
    for x in [0...Math.pow(@size, 3)]
      @grid
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Xx Itz Ian on October 22, 2013, 01:20:38 PM
Quote from: Iridion on October 22, 2013, 10:50:44 AM
Quote from: paranoia on October 22, 2013, 10:42:44 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

There are different formulas for different modeling/game languages such as python, assembly, java, c, c++, etc. There not all the same, however I do commend you on showing her the websites you have offered( considering there pretty good/useful) It probably wont help her in this situation. Allie should have posted the current axis of the model to make it much easier.


a formula is a formula

2+2 is the same thing in every language
however that is true there is a lot of difference within each programming language.

@rebuck
I think Allie is looking for something she can just copy paste, so you should remove the texts within each line.
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rebuck on October 22, 2013, 01:24:25 PM
Without Text!!!

class Map extends EventEmitter
  constructor: (size) ->
    throw new Error "Size must be between 1 and 255" unless 1 < size < 255



    @size = size

    @setMaxListeners 2


    @grid = new Array Math.pow(@size, 3)
    for x in [0...Math.pow(@size, 3)]
      @grid
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rebuck on October 22, 2013, 01:45:30 PM
Now I get a price  :o ??
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Iridion on October 22, 2013, 02:17:09 PM
Quote from: Xx Itz Ian on October 22, 2013, 01:20:38 PM
Quote from: Iridion on October 22, 2013, 10:50:44 AM
Quote from: paranoia on October 22, 2013, 10:42:44 AM
Quote from: CyberSox on October 22, 2013, 10:27:06 AM
Quote from: Purple on October 22, 2013, 10:15:34 AM
Quote from: CyberSox on October 22, 2013, 10:12:44 AM
Quote from: Purple on October 22, 2013, 09:55:10 AM
She wants a formula, not websites. I've already linked/read about 15 sites.

Those websites contain the matrices, making it easier, as you can't directly copy and paste them. But the most simple matrix for 3rd rotation:

(click to show/hide)

"...and noone in BC is either smart enough, or willing to go further than finding a page and telling me to figure it out from there"
- Allie 2013


I don't see any reason why I should listen to you. Stop pretending you're Allie's little sidekick, and going off topic. All I see you doing on this forums is being negative about others while not doing anything useful yourself. Back on topic, it's clear you haven't even clicked on the website, it contains a few of the required matrices to do the rotation. She asked for help, and that's the formula. She has to plug in her own values for Theta, Phi and Psi.

There are different formulas for different modeling/game languages such as python, assembly, java, c, c++, etc. There not all the same, however I do commend you on showing her the websites you have offered( considering there pretty good/useful) It probably wont help her in this situation. Allie should have posted the current axis of the model to make it much easier.


a formula is a formula

2+2 is the same thing in every language
however that is true there is a lot of difference within each programming language.

@rebuck
I think Allie is looking for something she can just copy paste, so you should remove the texts within each line.

but each formula in each programming language  has its "normal" version and thats what allie probably wants

for example |x| is done differently in c or vb.net but in both ways it is |x|
Title: Re: Serious question - 5000 Zylon Coins or other great reward
Post by: Rebuck on October 22, 2013, 02:19:45 PM
class Map extends EventEmitter
  constructor: (size) ->
    throw new Error "Size must be between 1 and 255" unless 1 < size < 255



    @size = size

    @setMaxListeners 2


    @grid = new Array Math.pow(@size, 3)
    for x in [0...Math.pow(@size, 3)]
      @grid
= null

    @rotation = 0

    map = @
    @blockDidChangeListener = ->
      map.emit 'didChange'

    @emit 'didChange'

  forceUpdate: ->
    @emit 'didChange'


  setBlock: (block, x, y, z, silent = no) ->
    @validateCoordinates x, y, z
    block.setCoordinates x, y, z if block

    [x, y] = @applyRotation x, y if @rotation
    position = x + y * @size + z * @size * @size

    @grid[position]?.removeListener 'didChange', @blockDidChangeListener
    @grid[position] = block
    @grid[position]?.addListener 'didChange', @blockDidChangeListener

    @emit 'didChange' unless silent


  getBlock: (x, y, z) ->
    @validateCoordinates x, y, z
    [x, y] = @applyRotation x, y if @rotation
    return @grid[x + y * @size + z * @size * @size]


  removeBlock: (x, y, z, silent = no) ->
    block = @getBlock x, y, z
    @setBlock null, x, y, z, yes

    block?.removeListener 'didChange', @blockDidChangeListener
    block?.setCoordinates null, null, null

    @emit 'didChange' unless silent

    return block


  heightAt: (x, y) ->
    @validateCoordinates x, y, 0

    height = 0
    while height < @size and @getBlock x, y, height
      height++
    return height


  getStack: (x, y, z = 0) ->
    @validateCoordinates x, y, z

    return [] if z > height = @heightAt x, y

    blocks = new Array
    for currentZ in [z...height]
      blocks.push @getBlock x, y, currentZ
    return blocks


  setStack: (blocks, x, y, z = 0, silent = no) ->
    @validateCoordinates x, y, z
    unless blocks.length - 1 + z < @size
      throw new Error "Cannot place stack, height out of bounds"

    for block in blocks
      @setBlock block, x, y, z++, yes

    @emit 'didChange' unless silent


  removeStack: (x, y, z = 0, silent = no) ->
    stack = @getStack x, y, z

    for currentZ in [z...z + stack.length]
      @setBlock null, x, y, z++, yes

    @emit 'didChange' unless silent

    return stack


  validate: ->
    @blocksEach (block) =>
      [x, y, z] = block.getCoordinates()
      if block and z > 0 and not @getBlock x, y, z - 1
        throw new Error "Encountered floating block at #{x}:#{y}:#{z}"


  validateCoordinates: (x, y, z) ->
    throw new Error "Index out of bounds #{x}:#{y}:#{z}" unless 0 <= x < @size and
                                                                0 <= y < @size and
                                                                0 <= z < @size


  applyRotation: (x, y) ->
    switch @rotation
      when  90 then return [@size - 1 - y,             x]
      when 180 then return [@size - 1 - x, @size - 1 - y]
      when 270 then return [            y, @size - 1 - x]
      else
        return [x, y]


  blocksEach: (functionToApply) ->
    x = @size - 1
    while x + 1
      y = 0
      while y < @size
        z = 0
        while z < @size
          functionToApply block if block = @getBlock(x, y, z)
          z++
        y++
      x--

  coordinatesEach: (functionToApply) ->
    x = @size - 1
    while x + 1
      y = 0
      while y < @size
        z = 0
        while z < @size
          functionToApply(x, y, z)
          z++
        y++
      x--


  rotateCW: -> @rotate true


  rotateCCW: -> @rotate false

  rotate: (clockwise, silent = no) ->
    if clockwise
      @rotation = (@rotation +  90) % 360
    else
      @rotation = (@rotation + 270) % 360

    for block in @grid
      if block
        block.rotate clockwise, yes, yes, yes, yes
        [x, y, z] = block.getCoordinates()
        if clockwise
          [x, y] = [            y, @size - 1 - x]
        else
          [x, y] = [@size - 1 - y,             x]
        block.setCoordinates x, y, z

    @emit 'didRotate', clockwise unless silen