#!/usr/bin/env entity -4 -4 6 -4 4 6 4 4 6 4 -4 6 -4 -4 6 -4 -4 -6 -4 4 -6 4 4 -6 4 -4 -6 -4 -4 -6 -4 6 -4 -4 6 4 4 6 4 4 6 -4 -4 6 -4 -4 -6 -4 -4 -6 4 4 -6 4 4 -6 -4 -4 -6 -4 -6 -4 -4 -6 -4 4 -6 4 4 -6 4 -4 -6 -4 -4 6 -4 -4 6 -4 4 6 4 4 6 4 -4 6 -4 -4 = 0} { set dx [expr $x - $X] set dy [expr $y - $Y] set RX [expr $RX + $dx] set RY [expr $RY + $dy] foreach point [$node children graph-point] { rotate_point $point $RX $RY } } set X $x set Y $y } proc sind alpha { return [expr sin($alpha * 0.0174533)] } proc cosd alpha { return [expr cos($alpha * 0.0174533)] } proc rotate_point {point rx ry} { set data [$point get_data] set x [lindex $data 0] set y [lindex $data 1] set z [lindex $data 2] set tmp [expr [cosd $rx] * $x + [sind $rx] * $z] set z [expr -[sind $rx] * $x + [cosd $rx] * $z] set x $tmp set tmp [expr [cosd $ry] * $y - [sind $ry] * $z] set z [expr [sind $ry] * $y + [cosd $ry] * $z] set y $tmp $point attrib x $x y $y } # initialize point attributes set object [enode object] foreach point [$object children graph-point] { rotate_point $point $RX $RY } ?>