Script that rotates background image?
All  1-7  8-9

Previous
Next
 From:  Max Smirnov (SMIRNOV)
8317.8 In reply to 8317.7 
Hi Martin,

this task is not easy :)
imp.frame specifies position of lower left corner of the image.

To rotate image around its center you need to find a central axis coordinates.
p0 = img.frame.evaluate(img.width/2, img.height/2, 0);
p1 = img.frame.evaluate(img.width/2, img.height/2, 1);

Then you need to rotate img.frame.origin, img.frame.xaxis and img.frame.yaxis points around this vector.
You can use google to find articles with titles like "Rotation about an arbitrary axis"

Also you can check my nodeeditor project. core/litegraph.js -> rotateAroundNormalizedVector function
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Martin (MARTIN3D)
8317.9 In reply to 8317.8 
Thank you Max for the tips.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-7  8-9