|
Author |
Topic: how to get a rotated point? (Read 256 times) |
|
_C
|
how to get a rotated point?
« on: Nov 16th, 2004, 9:37pm » |
|
hi everybody, i was wondering whether it was possible to get a rotated point from his coordinate system back to the 'screenworld', for lets say we got three points gliding around the middle of the stage like moons. then, how could i draw a line from lets say '200,0' to one object, so that it looks like the moon is hung up at the top of the screen? or, how it one point translated while the other one is not? thanks for any help c
|
|
|
|
fry
|
Re: how to get a rotated point?
« Reply #1 on: Nov 17th, 2004, 12:04am » |
|
not sure i totally understand your question, but screenX/Y/Z should do it: http://processing.org/reference/screenX_.html there's also objectX/Y/Z which will give you coordinates in "object" space (without the camera view), rather than screen space. this may be closer to what you're asking.
|
|
|
|
_C
|
Re: how to get a rotated point?
« Reply #2 on: Nov 17th, 2004, 12:18am » |
|
thanks ben. thats around what i meant. while having few objects that should rotate round a center, i wanted a line tracking the objects at one end, on the other beeing stable connected to some static point. so, as i found out, it is also possible to write a variable into the class which should return the points and set it *inside* the translation push() and pop() stacking to the screenx, screeny, screenz. puh. maybe sounds complicated but to keep things away from chaos, i tried to translate objects inside the classes so in the main loop, i only have to call the draw methods and have no trouble with what is beeing set in one way and the other object inanother. then you only need another float method returning the value or the absolute point of the called object. maybe object() does exactly that?
|
|
|
|
|