General Question Best approach for gauge animations on angled panel

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Sorry for another general question, but this has popup up on one of my LUA "exercices".

I managed to animate some instrument gauges on my Buran VC :thumbup: They are simple mesh groups that I placed above the general panel textured polygons.

I have no problem in defining animations and make the pointers rotate related to spacecraft altitude, yawn, etc. But since they are placed at an angle, and when I rotate them in Z, part of the geometry gets buried below the panel itself.
(See the center orange line over the artificial horizon, only half is visible)
130403004221baikalteste.jpg



What would you suggest as a solution?

I'm doing this:
prm1 = {type='rotation',mesh=1,grp=37,ref={x=-0.643536,y=1.959575,z=15.76159},axis={x=0,y=0,z=1},angle=0.5*PI}

I tried rotating also in X or Y, but saw no difference...
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
I think you need to rotate your rotational axis. It probably needs to read axis={x=0,y=1,z=1} in order to tilt the rotational axis at 45 to the horizontal. From what I can tell, the actual axis might be a little shallower, something like y=1, z=2.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Exactly, the axis must be corrected, to be normal to the panel. Also, I recommend leaving a bit more air between pointer and scale, since you always have some numerical inaccuracy in your axis vector definition and the Z-buffer of the rendering.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Made some progress but when I set another axis rotation to something else than zero, the mesh group changes size!

This is the starting situation (angle to the panel still not fully corrected):
130403225217baikalteste.jpg


And this is after some seconds of spinning at 100X acceleration!
130403225240baikalteste.jpg


No clue about why is this happening.:rolleyes:

(an yes, the rest of the artificial horizon instrument is functional...)
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
It is happening because the magnitude of your axis vector is not 1.0.

This magnitude is m = sqrt(x² + y² + z²)

It must be 1.0, otherwise it gets distorted during animation.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
I see! :facepalm:

I'm learning a lot and in the process we may get functional OK-GLI instruments on a SC3 vessel... I'm thinking about a system of selectable camera views, that will in effect turn the 3D VC into a 2D one... but one thing at a time.

---------- Post added at 23:49 ---------- Previous post was at 10:10 ----------

Well, what worked (as far as I can tell) is :

axis={x=0.0,y=-0.5,z=0.866}

I simply calculated the side lengths of a triangle aligned with the origin axes and intersecting the panel (I considered the panel as hypotenuse).

As simple as that :)
 
Top