Page 1 of 1

Placing an object on a planetary surface

Posted: 28.08.2012, 02:43
by NoXion
Hey there, Celestia addon developers! I was wondering if I could seek some assistance with placing an object on a planetary surface. I've got a nice .cmod mesh that I'd like to use as a colony city, but I'm having problems placing it correctly.

Here is the .ssc code as it stands:

Code: Select all

"The Syndicate of Ganymede" "Sol/Jupiter/Ganymede"
{
       Mesh "large_surface_base.cmod"
       Class "surfacefeature"
       Radius 10
       Albedo 0.5
       Orientation [ 45 1 0 1 ]

OrbitFrame { BodyFixed { Center "Sol/Jupiter/Ganymede"}}

FixedPosition
{
    Planetographic [ 270 47 1 ]
}

}


I'm also including a link to a zip file containing the above .ssc code and the mesh, HERE

What am I doing wrong? How can I get this object to just sit on the surface without spinning strangely?

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 07:04
by NoXion
Thanks a lot, that was very helpful. At least it is now stationary with respect to Ganymede's surface. :)

Now if only if I could get it to be the right way up...

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 07:42
by NoXion
OK, so it turns out there's an Edit mode for aligning meshes (SHIFT+@) which is definitely useful if a bit fiddly. But for some reason Celestia is not generating the align.log file when I press SHIFT+!.

I'm running Celestia 1.6.0 on a Windows 7 SP1 machine.

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 12:01
by Fenerit
Hi!. Do try this code for your object:

Code: Select all

SurfaceObject "The Syndicate of Ganymede" "Sol/Jupiter/Ganymede"
{
       
   Class "surfacefeature"
   Mesh "large_surface_base.cmod"
   Orientation [ 45 1 0 1 ]
   Radius 10
       
     
# OrbitFrame { BodyFixed { Center "Sol/Jupiter/Ganymede"}}

FixedPosition { Planetographic [ 270 47 1 ] }

FixedRotation { }

Albedo 0.5

}

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 13:38
by NoXion
Thanks, but the problem I'm having now is finding the right values for the Orientation variable so that the object is correctly aligned with the surface.

This is what it looks like using the code you provided:

Image

I've tried using the Edit Mode to get the right Orientation values, but it's no good since Celestia doesn't seem to be able to create the align.log file.

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 18:49
by Chuft-Captain
You shouldn't mix together the old style Orientation syntax with the newer Reference Frame code.

Either use a LongLat statement with an Orientation (old syntax):

Code: Select all

"The Syndicate of Ganymede" "Sol/Jupiter/Ganymede"
{
       Mesh "large_surface_base.cmod"
       Class "surfacefeature"
       Radius 10
       Albedo 0.5

LongLat   [270 47 0.005 ]
Orientation   [47 1 0 0]
}


... or use the new syntax (recommended):

Code: Select all

"The Syndicate of Ganymede" "Sol/Jupiter/Ganymede"
{
       Mesh "large_surface_base.cmod"
       Class "surfacefeature"
       Radius 10
       Albedo 0.5

# OrbitFrame / FizedPosition to position the object:
#
   OrbitFrame { BodyFixed { Center "Sol/Jupiter/Ganymede"}}
   FixedPosition
   {
       <...>
   }

# BodyFrame / FixedRotation to set it's orientation:
#
   BodyFrame { BodyFixed { Center "Sol/Jupiter/Ganymede" } }
   FixedRotation
   {
      Inclination            <value>
      AscendingNode    <value>
      MeridianAngle    <value>
   }


}


In the new syntax, the type of reference frame, and values for the FixedRotation will depend on how your model is aligned in your modelling tool (eg Anim8ter, Blender) and whether it's output as a 3ds or cmod file.
(You'll probably need to experiment a bit to get the right values, but making sure the model is correctly axis aligned in the modeller first will simplify this process.)

CC

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 19:14
by Reiko
NoXion wrote:

I've tried using the Edit Mode to get the right Orientation values, but it's no good since Celestia doesn't seem to be able to create the align.log file.
For Celestia to create the align.log file you have to start it via command prompt. Start Celestia with this added string celestia --verbose >align.log

When you align your model hit shit ! and it will save the orientation values to the align.log file.

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 20:15
by NoXion
Reiko wrote:For Celestia to create the align.log file you have to start it via command prompt. Start Celestia with this added string celestia --verbose >align.log

When you align your model hit shit ! and it will save the orientation values to the align.log file.

Ah OK, I didn't know that. Now why does one have to jump through that hoop? Why can't Celestia generate the file as its default behaviour? Just start Celestia, go into Edit Mode, align, save, exit, job done and align.log generated.

Because then we could avoid situations like the following:

Code: Select all

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Steven>cd C:\Program Files (x86)\Celestia

C:\Program Files (x86)\Celestia>celestia.exe --verbose >align.log
Access is denied.

C:\Program Files (x86)\Celestia>


Buh?! Access denied? But I should have admin privileges! AARGH!

Re: Placing an object on a planetary surface

Posted: 28.08.2012, 20:40
by fungun
When you align your model hit shit ! and it will save the orientation values to the align.log file.
Hey, Reiko, I don't have that key. :lol: :lol: :lol: :lol:

Re: Placing an object on a planetary surface

Posted: 29.08.2012, 03:24
by John Van Vliet
--- edit ---

Re: Placing an object on a planetary surface

Posted: 29.08.2012, 07:47
by NoXion
john Van Vliet wrote:question
the OLD 1.6.0 and NOT the current 1.6.1 ?
or
the beta 1.7

1.7.0 has been forked off and is in testing

Nope, it's as I wrote it: I'm running Celestia 1.6.0, and not any of the other versions you mentioned.

because Celestia has to work on different platforms with DIFFERENT user interfaces

Windows XP,Vista,Win7 ( gtk and QT)
Mac osx 10.? (qt)
Linux ( QT and GTK )

Mac and Linux are in the Unix family
windows is in it's own world
Windows 8 "metro" might not even get supported ????
that is an unknown

Different user interfaces? The controls for Celestia appear to be the same regardless of OS. Or am I misunderstanding what you mean by "user interface"?

??? Are you running Windows 7 AS AN ADMINISTRATOR ????
if so NOT GOOD
use a normal user account

Well, I'm not sure actually. I get those little windows asking me if I want to let [program I just executed] make changes to my computer. But the point is that I am the owner and sole user of this machine, so getting an "access denied" should not be happening!

there is a known bug in how windows FUBARED the UAC in win 7
it IS recommended you install celestia to /
that is to
C:\\Celestia\celestia.exe

this fixes MS's "bleeped" up UAC errors

Thank you, moving my Celestia folder has fixed it. I have now derived the Orientation values I was looking for. Check it:

Image

Although you can see an atmosphere in the above image, the Syndicate had built their self-contained city on Ganymede long before that moon's para-terraformation. To give a sense of scale, the tallest towers in the image are about 2000 metres, roughly equivalent to 500 floors.

It's still not complete, but if anyone's interested, HERE is the addon in it's current state. It's part of a personal project that I may or may not publicly release, depending on how much time and effort I want to dedicate to it.

Thanks to everyone who helped!

Re: Placing an object on a planetary surface

Posted: 29.08.2012, 08:27
by John Van Vliet
--- edit ---

Re: Placing an object on a planetary surface

Posted: 29.08.2012, 14:22
by NoXion
john Van Vliet wrote:you ARE aware that 1.6.0 was released in 2009 ? right? 3 years out of date
celestia-win32-1.6.0.exe 2009-07-09 35.2 MB
and dose NOT support a lot of things that 1.6.1 now dose

i would install 1.6.1
http://sourceforge.net/projects/celesti ... bin/1.6.1/

I actually didn't realise the version I was running was that old. I've upgraded my installation accordingly.

Re: Placing an object on a planetary surface

Posted: 29.08.2012, 15:14
by selden
Noxion,

Referring back to your orientation problem, if you use the directive SurfaceObject, as shown in Fenerit's example, objects are automatically oriented perpendicular to the local surface on a sphere. You do not have to use Orientation or Rotation directives to make that happen.

Re: Placing an object on a planetary surface

Posted: 31.08.2012, 05:36
by Reiko
fungun wrote:
When you align your model hit shit ! and it will save the orientation values to the align.log file.
Hey, Reiko, I don't have that key. :lol: :lol: :lol: :lol:
Oops hehe :lol: :blue: