1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Rotating around corner and center

Posted by Kumar on Jun 07, 2010

Hi,
I would like to rotate around corner and then rotate around center. Something like this:

transform(CORNER)
 translate(250, 250)
 rotate(-90)
 transform(CENTER)
 rotate(180)
 text('8', 0, 0)
What I intend to do is "flip horizontal" at new origin point (250, 250).

However, the rotation is done based on the last transform command hence, the rotation is done effectively of 90 (-90 + 180) around the CENTER since my last transform command sets it to CENTER.

How do I achieve the "flip horizontal"?

Thanks.

-Kumar


 
Posted by Lucas on Jun 07, 2010

Something like this?

transform(CORNER)
translate(250, 250)
rotate(-90)
#text('8', 0, 0, draw=True)
transform(CENTER)
scale(-1)
text('8', 0, 0, draw=True)



Posted by Kumar on Jun 07, 2010

The above does not do the "flip horizontal" across an origin. I am looking to do this:

original:
| 8
------|------
|

To

|
------|------
| 8

But the "8" is also flipped (which I am not able to show here).

Thanks.



Posted by Josh Caswell on Jun 11, 2010

Try looking at the NodeBox Transform object. These two old forum posts may be helpful too.



Posted by Josh Caswell on Jun 11, 2010

These two old forum posts:
Post 1 Post 2