Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411492 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 05:16:24 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Correct motion of stars across screen
Pages: [1]
Print
Author Topic: Correct motion of stars across screen  (Read 808 times)
tjcbs
Level 1
*


View Profile WWW
« on: January 13, 2015, 12:46:01 AM »

I don't know if this is obvious or not. My visual intelligence is even worse than the other areas. But,

The screen is centered on a planet, which is (very quickly) orbiting a sun, clockwise. The camera is pointed parallel to the axis of rotation, so that the sun is not seen. The screen rotates around the sun, along with the planet, and orients itself with the planet, so that the planet appears stationary.

What path do the stars take across the screen?
Logged

bdsowers
Level 3
***



View Profile WWW
« Reply #1 on: January 13, 2015, 04:36:03 AM »

I'm not entirely sure if this is what you're asking, but:

Assuming the stars are stationary (you're not modeling any gravitational pulls for them), they'll appear to go in the opposite direction of your planet. That is, they'll have a curved path, and it will change depending on where the planet is in its cycle.
Logged

jgrams
Level 3
***



View Profile
« Reply #2 on: January 13, 2015, 04:38:13 AM »

Rotating the screen around the center of the sun is the same as rotating the world around the center of the sun in the opposite direction. So if you have a circular orbit, they'll be circular arcs...

--Josh
Logged
Christian Knudsen
Level 10
*****



View Profile WWW
« Reply #3 on: January 13, 2015, 05:19:00 AM »

Right to left.

EDIT: Never mind. I thought the camera was pointed at the planet with the sun in the background.
Logged

Laserbrain Studios
Currently working on Hidden Asset (TIGSource DevLog)
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #4 on: January 13, 2015, 02:50:48 PM »

It's easiest to think of stars as dots on a big black sphere which is always centered on the camera (i.e. a skybox). Until you are moving light years, this approximation holds up pretty well. From this point of view, it's clear the only relevant camera motion is the roll, there's no pitch or yaw.

So they'll rotate around the screen center, due to the camera rotation to maintain the sun in the "up" direction on the screen. Any star in the dead center of the screen won't move.
Logged
Christian Knudsen
Level 10
*****



View Profile WWW
« Reply #5 on: January 13, 2015, 11:44:54 PM »

So they'll rotate around the screen center, due to the camera rotation to maintain the sun in the "up" direction on the screen. Any star in the dead center of the screen won't move.

Won't the stars be rotating around the sun, which is out of frame?
Logged

Laserbrain Studios
Currently working on Hidden Asset (TIGSource DevLog)
Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #6 on: January 14, 2015, 12:03:04 AM »

Won't the stars be rotating around the sun, which is out of frame?

The point is they are so far away from the camera that it doesn't matter if they rotate around the sun or the screen center, it will look the same. At least if you kept the scale real it wouldn't make a difference since in relation to interstellar distances the earth and the sun are pretty much the same place, but since this is just a game the closest approximation is rotating them around the screen center and having the scale be whatever.
Logged

Christian Knudsen
Level 10
*****



View Profile WWW
« Reply #7 on: January 16, 2015, 04:28:19 PM »

Ahh, yes. That makes sense.
Logged

Laserbrain Studios
Currently working on Hidden Asset (TIGSource DevLog)
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic