Page 1 of 1

center() and goto() can't be concurrent?

Posted: 28.03.2008, 20:01
by rbroberts
It would seem that I can't do

Code: Select all

obs:goto(object)
obs:center(other_object)

When I attempt to do so, the goto is interrupted and does not complete. This is celestia 1.5.0. Is this normal behavior? Is there a way to do both at the same time?

What I'm trying to do is smoothly change both my location and my view so that I am in LEO looking at the moon.

Re: center() and goto() can't be concurrent?

Posted: 29.03.2008, 08:44
by Vincent
Just add a wait() command after goto() and center():

Code: Select all

obs:goto(object)
wait(5)
obs:center(other_object)
wait(5)

Re: center() and goto() can't be concurrent?

Posted: 31.03.2008, 18:22
by rbroberts
Yes, I know about wait. What I'm actually doing right now is

Code: Select all

obs:goto(L1)
while obs:travelling() do
  wait(0.25)
end
obs:center(moon)

but that's not simultaneous which is what I was asking. It would be nice to be able to both move and orient at the same time. I guess I need to post on the feature request board.

roland

Re: center() and goto() can't be concurrent?

Posted: 01.04.2008, 01:03
by buggs_moran
I am actually working on something like that but it is slow going. So far I have the celx turning to the object while moving but I have a ways to go... I will post when I finish.

I also wanted to add to the previous code snippets you guys posted. Instead of using wait, I found the boolean observer:traveling() works well. It returns a "true" if you are, well, traveling... but again that is not simultaneous.

Re: center() and goto() can't be concurrent?

Posted: 01.04.2008, 12:13
by ajtribick
Can't you track the object you want to centre and then do the goto?

Re: center() and goto() can't be concurrent?

Posted: 10.04.2008, 00:00
by rbroberts
track jumps, center slews gradually. I want the smooth motion effect.

I can, in principle, do this with the long form of goto, but it is a lot more work since you have to use positions instead of objects. And as the manual points out, doing a goto on an object position is not the same as doing a goto on an object.