How to orient a DSC object ?

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

How to orient a DSC object ?

Post #1by Cham » 26.10.2008, 17:30

I'm trying to rotate an arrow in the galactic plane, with an angle of 45° :
orientation.jpg


Anyone has an idea how ? The Orientation [ ] command doesn't work for DSC objects (which could help alot !). I can't do it in my modeler since the double-head-arrow is a pure CMOD object and I don't want to build a new arrow model for this (however, if there's no easy and "natural" way, I may have to design a new CMOD object). Here's the DSC code used for the central arrow shown on the picture :

Code: Select all

Nebula "MW_arrow"
{
   Mesh "double_arrow.cmod"
   #Visible false
   Clickable false
   RA 17.760278
        Dec -28.936111
        Distance 27720
        Radius 50000
   Axis [-0.679381 0.221716 -0.699488]
   Angle 196.475
}

Nebula "100000AL"
{
   Mesh "100000AL.3ds"
   #Visible false
   Clickable false
   RA 17.760278
        Dec -28.936111
        Distance 32720
        Radius 10000
   Axis [-0.679381 0.221716 -0.699488]
   Angle 196.475
}


In case someone is interested in building pure CMOD geometries, here's the code used for the CMOD double-head-arrow :

Code: Select all

#celmodel__ascii

material  # Basic color
   emissive 0.8 0.9 0.9
   diffuse  0.8 0.9 0.9
   opacity 0.5
end_material

mesh
vertexdesc position f3 end_vertexdesc

vertices 2  # Straight line
0 0.9133974596 0
0 -0.9133974596 0

linestrip 0 2
0
1

end_mesh

# First arrow :

mesh vertexdesc position f3 end_vertexdesc # Frame
 
vertices  3
0 1 0
0.025 0.9133974596 0
-0.025 0.9133974596 0

linestrip 0  4
0
1
2
0

end_mesh

mesh vertexdesc position f3 end_vertexdesc # Glass arrow
 
vertices  3
0 1 0
0.025 0.9133974596 0
-0.025 0.9133974596 0

trilist 0  3
0
1
2

end_mesh

mesh vertexdesc position f3 end_vertexdesc # Glass arrow second face
 
vertices  3
0 1 0
-0.025 0.9133974596 0
0.025 0.9133974596 0

trilist 0  3
0
1
2

end_mesh

# Second arrow :

mesh vertexdesc position f3 end_vertexdesc # Frame
 
vertices  3
0 -1 0
0.025 -0.9133974596 0
-0.025 -0.9133974596 0

linestrip 0  4
0
1
2
0

end_mesh

mesh vertexdesc position f3 end_vertexdesc # Glass arrow
 
vertices  3
0 -1 0
0.025 -0.9133974596 0
-0.025 -0.9133974596 0

trilist 0  3
0
1
2

end_mesh

mesh vertexdesc position f3 end_vertexdesc # Glass arrow second face
 
vertices  3
0 -1 0
-0.025 -0.9133974596 0
0.025 -0.9133974596 0

trilist 0  3
0
1
2

end_mesh
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: How to orient a DSC object ?

Post #2by selden » 27.10.2008, 11:39

DSC objects can be oriented using Axis and Angle directives.
I've used them to place Nebula objects so they're face-on toward the Earth.

Methods that I've used are described at
http://www.lepp.cornell.edu/~seb/celest ... d.html#6.0
I'll have to leave it to you to do the rotations for orienting them in the appropriate coordinate system.
Selden

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: How to orient a DSC object ?

Post #3by t00fri » 27.10.2008, 13:08

I have oriented 10000+ galaxies in Celestia ;-). The respective routine is part of my Perlscript in the tools/galaxies directory of the Celestia distribution. It is human readable. With a few quaternion actions, it calculates the correct axis-angle values for arbitrary, RA, Dec, position angle relative to north towards east, inclination etc.

It's exeedingly simple.

Fridger
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: How to orient a DSC object ?

Post #4by Cham » 27.10.2008, 13:14

My problem is not to orient the DSC object toward Earth (I can use Grant's Excel tool for that). My problem is to rotate the DSC object in a plane. In the case above, I need to rotate the arrow in the galactic plane.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: How to orient a DSC object ?

Post #5by selden » 27.10.2008, 14:53

That's why I commented
'll have to leave it to you to do the rotations for orienting them in the appropriate coordinate system.
Selden

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: How to orient a DSC object ?

Post #6by t00fri » 27.10.2008, 15:23

Cham wrote:My problem is not to orient the DSC object toward Earth (I can use Grant's Excel tool for that). My problem is to rotate the DSC object in a plane. In the case above, I need to rotate the arrow in the galactic plane.

That's also easily possible with my Perl routine, but I know already that you are reluctant to learn a bit of Perl ;-)

You simply enter the MilkyWay RA and Dec coordinates into my orientation routine, set inclination $i such that you look head-on at it from Earth ("skyplane") and then use the Position angle $PA to do the rotation in that plane... But actually, you did not precisely describe your task, like in what frames you work etc.

Fridger
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: How to orient a DSC object ?

Post #7by Cham » 27.10.2008, 17:33

I "simply" need to rotate the arrow in the MW frame (more precisely : a plane rotation in the MW galactic plane). Currently, the arrow is well oriented in the galactic plane (tangent to it), but still need a rotation around an axis perpendicular to the MW plane. The only easy way is to build a new CMOD object with the proper rotation already done. Maybe we need some new options for DSC objects, like what we have for SSC objects in 1.6.0 ("roll", "tilt" and "heading").
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: How to orient a DSC object ?

Post #8by t00fri » 27.10.2008, 18:00

Cham wrote:I "simply" need to rotate the arrow in the MW frame (more precisely : a plane rotation in the MW galactic plane). Currently, the arrow is well oriented in the galactic plane (tangent to it), but still need a rotation around an axis perpendicular to the MW plane. The only easy way is to build a new CMOD object with the proper rotation already done. Maybe we need some new options for DSC objects, like what we have for SSC objects in 1.6.0 ("roll", "tilt" and "heading").

That I have understood earlier. But how will that add-on be looked at!?? Is it just a display of the MW in head-on view with some overlaid arrows etc., or do you want the overlaid stuff to be viewed at arbitrary angles "online" in Celestia? If the former is correct, you can also use the skyplane instead of the galactic plane and rotate via PA angle with head-on inclination.

So, in the former case, my above recipe is a trivial solution.

Fridger
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: How to orient a DSC object ?

Post #9by Cham » 27.10.2008, 20:11

t00fri wrote:But how will that add-on be looked at!?? Is it just a display of the MW in head-on view with some overlaid arrows etc., or do you want the overlaid stuff to be viewed at arbitrary angles "online" in Celestia?

The arrow should stay in the galactic plane. It will be visible only when the galaxy is viewed head-on. Since the CMOD object is planar, it would almost disappear if the galaxy is viewed on the sides. In other words, it's a head-on display with some overlaid arrows, as you said (there's currently no way I could display the arrow "online" in Celestia, whatever the observer's position).

This is just about a static, planar schematic layer drawn on the galaxy's plane, nothing more.

Using a similar way, I want to add magnetic field maps on the galaxy, or other kind of information (distribution of hydrogen clouds, etc).
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: How to orient a DSC object ?

Post #10by t00fri » 27.10.2008, 20:31

Cham wrote:
t00fri wrote:But how will that add-on be looked at!?? Is it just a display of the MW in head-on view with some overlaid arrows etc., or do you want the overlaid stuff to be viewed at arbitrary angles "online" in Celestia?

The arrow should stay in the galactic plane. It will be visible only when the galaxy is viewed head-on. Since the CMOD object is planar, it would almost disappear if the galaxy is viewed on the sides. In other words, it's a head-on display with some overlaid arrows, as you said (there's currently no way I could display the arrow "online" in Celestia, whatever the observer's position).

This is just about a static, planar schematic layer drawn on the galaxy's plane, nothing more.

Using a similar way, I want to add magnetic field maps on the galaxy, or other kind of information (distribution of hydrogen clouds, etc).

But then I could mock up the desired rotation in no time. But unfortunately I got less than no time ;-)

But don't you agree that all you need is a head-on view of the MW in SOME plane. Then you can rotate the galaxy in that plane by 45 degrees. I simply can modify the MW data to make it appear head on at the skyplane. Then PA is the angle to rotate the galaxy in that sky plane.

Unfortunately I have never cared how these new overlays work. I am already "educated". So no need of that stuff for me ;-)

Fridger
Last edited by t00fri on 27.10.2008, 20:35, edited 1 time in total.
Image

Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: How to orient a DSC object ?

Post #11by Cham » 27.10.2008, 20:33

t00fri wrote:But then I could mock up the desired rotation in no time. But unfortunately I got less than no time ;-)

Don't bother with this, Fridger. I much prefer that you tweak the globular clusters instead ! :wink:

I'll find a simple solution to my problem. It's just about an arrow...
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: How to orient a DSC object ?

Post #12by t00fri » 27.10.2008, 20:38

Cham wrote:
t00fri wrote:But then I could mock up the desired rotation in no time. But unfortunately I got less than no time ;-)

Don't bother with this, Fridger. I much prefer that you tweak the globular clusters instead ! :wink:

I'll find a simple solution to my problem. It's just about an arrow...

Yes after my hard-working weekend with the new DXT output of my texture tools

http://forum.celestialmatters.org/viewt ... 73&start=0

I am back at the globular tweaking...

Fridger
Image


Return to “Celestia Users”