Hello everyone,
this is my first question here and I really hope there was no one before me asking that question. At least I haven't found that question. And as some additional information: I'm a total noob to Unity and 3D Game programming overall. Last but not least I'm no native english speaker so sorry for any language mistake may occuring. ;-P
I got the following problem:
I want to rotate a sphere (my earth-object) around fixed axis which to not rotate when I rotate my sphere. It's a little bit hard to explain, so I give it another try: Let's say there is a parent object with a coordinate system. The (only) child of that parent object is the sphere. Now I want to turn the sphere as a child around the parents coordinate system axis. By rotating the child, the parent shouldnT be affected, so the coordinate system and the axis shouldn't be 'taffected neither. Am I right?
Well, that's my problem... No matter which rotation function I use and which object (parent, parents parent, Space.World) I referenced, it always seems like the coordinate system rotates, too.
So, is there the possibility of achieving my goal to just rotate the earth around fixed axis without rotating those axis?
--- End of Question ---
--- In the following I'll give an example what I want to achieve in the end ---
For everyone not really understanding my Problem I want to give my overall-goal:
I got the latitude and longitude of a spezific city or whatever and I want to rotate the earth in that way that you can see that given point.
Now when I rotate the earth around the calculated value for the EulerAngle of the given latitude (rotation around the "x"-axis, the "y"-axis and "z"-axis will rotate, too. If I now rotate around the "y"-axis for my longitude I now rotate around the wrong axis. So I have to calculate a vector, which is pointing up (north) to rotate around. Vector3.up seems to be not working for me or I am using it in a wrong way...
Does anyone know how to handle this rotating problem the best way?
Thank you all in advance for your very appreciated help!!
↧