Page 1 of 1

How to orient a DSC object ?

Posted: 26.10.2008, 17:30
by Cham
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

Re: How to orient a DSC object ?

Posted: 27.10.2008, 11:39
by selden
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.

Re: How to orient a DSC object ?

Posted: 27.10.2008, 13:08
by t00fri
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

Re: How to orient a DSC object ?

Posted: 27.10.2008, 13:14
by Cham
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.

Re: How to orient a DSC object ?

Posted: 27.10.2008, 14:53
by selden
That's why I commented
'll have to leave it to you to do the rotations for orienting them in the appropriate coordinate system.

Re: How to orient a DSC object ?

Posted: 27.10.2008, 15:23
by t00fri
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

Re: How to orient a DSC object ?

Posted: 27.10.2008, 17:33
by Cham
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").

Re: How to orient a DSC object ?

Posted: 27.10.2008, 18:00
by t00fri
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

Re: How to orient a DSC object ?

Posted: 27.10.2008, 20:11
by Cham
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).

Re: How to orient a DSC object ?

Posted: 27.10.2008, 20:31
by t00fri
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

Re: How to orient a DSC object ?

Posted: 27.10.2008, 20:33
by Cham
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...

Re: How to orient a DSC object ?

Posted: 27.10.2008, 20:38
by t00fri
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