Rotation point - How to not in center??


    Jun 14 2008 | 4:17 pm
    Dear Jitterlist!!
    I think this little question have more solutions, but in this time I'm don't know anyone ((
    How to change center of rotating point if I need it not in center of gridshape, but in one of it's corner ???
    And another important thing - I have many gridshapes and all of it need to rotate in same direction and have same point of rotating!! So solution with rotation all of rendered world is no good way (
    Please prompt!
    In the end of work it's must be a model of human moving using Wiimote and camera. That you're can suppose - I need joint(articulation) to model body!
    Thanks for your time!!
    Cheers

    • Jun 17 2008 | 5:02 pm
      On Sat, Jun 14, 2008 at 5:17 PM, outoff wrote:
      >
      > How to change center of rotating point if I need it not in center of
      > gridshape, but in one of it's corner ???
      > And another important thing - I have many gridshapes and all of it need to
      > rotate in same direction and have same point of rotating!! So solution with
      > rotation all of rendered world is no good way (
      > Please prompt!
      >
      > In the end of work it's must be a model of human moving using Wiimote and
      > camera. That you're can suppose - I need joint(articulation) to model body!
      >
      >
      This would be easier to do using a procedural language like JS or Lua, where
      you have full control over the OpenGL state. I'm sure you can do it in a
      patch, but I can't tell you how, and I think it'll gets very messy very
      quickly.
      This is how you do it using opengl commands:
      -translate the object so that 0,0,0 is located at one or its corners.
      -rotate
      -translate inverse amount
      Now your object will be back where it was, but rotated around the corner
      point. You can use glTranslate and glRotate for it, in combination with the
      gridshape drawraw method. Drawraw lets the object use the current
      transformation, instead of resetting the OpenGL state to the position and
      rotation attributes on drawing. You don't want that, because otherwise your
      gl* transforms don't have any effect.
      If you plan to do use this kind of thing to build a skeleton, you definitely
      want to go the procedural route. Look into "scenegraph". You want to cascade
      matrix transformations to build a skeleton.
      You can find the basics the OpenGL redbook, as always.
      I know one book, which I can recommend, that has an example:
      "Essential mathematics for games & interactive applications" page 148.
      I had to struggle with this book since my math background is really poor,
      but well worth the effort if you're serious about this subject. It might be
      overkill for you though... I'm sure you can find tutorials online as well.
      Sorry for the somewhat overly complicated response. Hope it's helpful.
      Thijs
    • Jun 18 2008 | 11:09 am
      yep-yep! thanks! any information is helpful)
      how do you think, may be this commands are understands by jit.gl.sketch? cause languages like js it's seems to difficult within some education((
      thanks again!!
    • Jun 18 2008 | 12:25 pm
      On Wed, Jun 18, 2008 at 12:09 PM, outoff wrote:
      >
      > yep-yep! thanks! any information is helpful)
      > how do you think, may be this commands are understands by jit.gl.sketch?
      > cause languages like js it's seems to difficult within some education((
      >
      Yes jit.gl.sketch will do, although I've never really understood why people
      use it. I personally find Javascript/Lua a lot easier to work with.
      I do think it's really essential to learn a procedural language in addition
      to Max. It might seem a bit difficult to start with, but it's really not any
      more difficult than patching. Both approaches are just very different.
      Patching is great in a lot of ways, but some things are really hard or
      nearly impossible to do in a patch, while they might be easy to implement in
      a procedural way. Only when you know both you can choose the right tool for
      the job.
      My 2c,
      Thijs
    • Jun 18 2008 | 12:50 pm
      I agree with Thijs regarding learning a procedural language. But in this case, you may get what you want quite easily with sketch.
      Check out this thread from a few months ago: Look at ondandoff's attached patch. This may help.
    • Jun 18 2008 | 9:23 pm
      Thank u a LOT, guys!!!
      One thing as result - one eye look at possibilities of scripting languages, another one - needed command is founded !!!
      Forum again save me!!
      Cheers