move - in a straight line via move command - how?

All about writing scripts for Celestia in Lua and the .cel system
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 6 months
Location: Colorado, USA (7000 ft)

move - in a straight line via move command - how?

Post #1by don » 27.01.2004, 20:45

Howdy All,

I'm trying to use the move command to move several hundred light years, in a straight line, without any luck. With the velocity value being a vector, the camera refuses to move in a straight line directly towards the selected object (Sol), regardless of the coordinate system or how I fill the vector values.

The changedistance command does not use a steady velocity, which I need.

Has anyone gotten the move command to move in a straight line? If yes, how did you do it?

Thank you!

-Don G.

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 6 months
Location: Colorado, USA (7000 ft)

Post #2by don » 28.01.2004, 00:49

Anyone?

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 4 months
Location: Germany

Re: move - in a straight line via move command - how?

Post #3by Harry » 28.01.2004, 07:40

don wrote:I'm trying to use the move command to move several hundred light years, in a straight line, without any luck. With the velocity value being a vector, the camera refuses to move in a straight line directly towards the selected object (Sol), regardless of the coordinate system or how I fill the vector values.

Looks like move always uses the Universal Frame-of-Reference. Sou you would need to know the current position in Universal coordinates, then compute the direction to the sun and use that for your vector.

Did I mention that Lua ... Ah, never mind. :lol:

Harald

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 23 years
Location: Seattle, Washington, USA

Re: move - in a straight line via move command - how?

Post #4by chris » 28.01.2004, 08:51

Looks like move always uses the Universal Frame-of-Reference. Sou you would need to know the current position in Universal coordinates, then compute the direction to the sun and use that for your vector.

Did I mention that Lua ... Ah, never mind. :lol:


Yes, this really seems like the sort of thing for which Lua is much better suited. In order for a move command to be useful, the script would have to calculate start and end points, and there's no provision for computation or variables in the old script system.

--Chris

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 6 months
Location: Colorado, USA (7000 ft)

Post #5by don » 28.01.2004, 16:12

Thanks guys. I had hoped it was something I was just missing. This is such a simple thing. All the script needs to do is move forward, in a straight line, at a constant speed. :(

For anyone interested, the code snippet below sets things up. The changedistance command speeds up and slows down, which is why I'm not using it.

It would seem that THREE velocity values need to be specified in order to make the camera move in a straight line, but what values? The velocity needs to be approx. 3 ly/s.

Thanks!

-Don G.

PS. I'm going to town in 45 minutes and will be gone until this evening.

Code: Select all

  time { jd 2453031.43919 }

# Go to a position 200 ly from Sol ...

  seturl { url "cel://Follow/Sol/2003-12-27T13:36:11.94781?x=AAAAAEDpwsWUhfT7/////w&y=CkxgAKBCOkQFIBIC&z=VcpQAACchFReAAD1/////w&ow=0.174547&ox=0.014574&oy=0.980768&oz=0.086108&select=Sol&fov=31.999994&ts=1.000000<d=0&rf=40887&lm=49152" }

#  wait   { duration 5 }

#--------------------------------------------------------------
# BEGIN TEST SECTION

  unmark { object "Sol" }
  mark   { object "Sol"
           size 10
           color [1 0 0]
           symbol "square" }

  renderflags { set "markers" }

  cancel {}
  select { object "Sol" }

#  follow {}

#  track {}

#chase
#ecliptical
#equatorial
#geographic
#lock
#observer
#universal

  setframe { target "Sol"
             coordsys "universal" }
  wait   { duration 2 }

  move { duration 90  velocity [ 28381585214538 0 0 ] }

# END TEST SECTION
#------------------------------------------------------------


Return to “Scripting”