Board index FlightGear Development Spaceflight

Space Shuttle

Discussion about development and usage of spacecraft

Re: Space Shuttle

Postby Hooray » Mon Apr 13, 2015 1:18 am

to draw curves instead of line segments, see the APIs available for OpenVG paths (OpenVG being hardware-accelerated vector graphics), as per api.nas:

http://sourceforge.net/p/flightgear/fgd ... as/api.nas
Code: Select all
# Move path cursor
  moveTo: func me.addSegment(me.VG_MOVE_TO_ABS, arg),
  move:   func me.addSegment(me.VG_MOVE_TO_REL, arg),
  # Add a line
  lineTo: func me.addSegment(me.VG_LINE_TO_ABS, arg),
  line:   func me.addSegment(me.VG_LINE_TO_REL, arg),
  # Add a horizontal line
  horizTo: func me.addSegment(me.VG_HLINE_TO_ABS, arg),
  horiz:   func me.addSegment(me.VG_HLINE_TO_REL, arg),
  # Add a vertical line
  vertTo: func me.addSegment(me.VG_VLINE_TO_ABS, arg),
  vert:   func me.addSegment(me.VG_VLINE_TO_REL, arg),
  # Add a quadratic Bézier curve
  quadTo: func me.addSegment(me.VG_QUAD_TO_ABS, arg),
  quad:   func me.addSegment(me.VG_QUAD_TO_REL, arg),
  # Add a cubic Bézier curve
  cubicTo: func me.addSegment(me.VG_CUBIC_TO_ABS, arg),
  cubic:   func me.addSegment(me.VG_CUBIC_TO_REL, arg),
  # Add a smooth quadratic Bézier curve
  squadTo: func me.addSegment(me.VG_SQUAD_TO_ABS, arg),
  squad:   func me.addSegment(me.VG_SQUAD_TO_REL, arg),
  # Add a smooth cubic Bézier curve
  scubicTo: func me.addSegment(me.VG_SCUBIC_TO_ABS, arg),
  scubic:   func me.addSegment(me.VG_SCUBIC_TO_REL, arg),
  # Draw an elliptical arc (shorter counter-clockwise arc)
  arcSmallCCWTo: func me.addSegment(me.VG_SCCWARC_TO_ABS, arg),
  arcSmallCCW:   func me.addSegment(me.VG_SCCWARC_TO_REL, arg),
  # Draw an elliptical arc (shorter clockwise arc)
  arcSmallCWTo: func me.addSegment(me.VG_SCWARC_TO_ABS, arg),
  arcSmallCW:   func me.addSegment(me.VG_SCWARC_TO_REL, arg),
  # Draw an elliptical arc (longer counter-clockwise arc)
  arcLargeCCWTo: func me.addSegment(me.VG_LCCWARC_TO_ABS, arg),
  arcLargeCCW:   func me.addSegment(me.VG_LCCWARC_TO_REL, arg),
  # Draw an elliptical arc (shorter clockwise arc)
  arcLargeCWTo: func me.addSegment(me.VG_LCWARC_TO_ABS, arg),
  arcLargeCW:   func me.addSegment(me.VG_LCWARC_TO_REL, arg),
  # Close the path (implicit lineTo to first point of path)
  close: func me.addSegment(me.VG_CLOSE_PATH),
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11782
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby Thorsten » Mon Apr 13, 2015 11:48 am

Something visual... the joy of submodels :-) The separation dynamics isn't perfect yet, but perhaps the external force can be applied to simulate the effect of the separation motors pushing the boosters away from the stack.

Image

Image
Thorsten
 
Posts: 11604
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby Bjoern » Tue Apr 14, 2015 2:38 pm

This separation trajectory would have made for a nice explosion in Kerbal Space Program - and a subsequent rescue mission, assuming that the rest of the orbiter had stayed intact and had made it to orbit.
Bjoern
 
Posts: 469
Joined: Fri Jan 06, 2012 10:00 pm
Location: TXL or so
Version: Next
OS: ArchLinux, Win 10

Re: Space Shuttle

Postby wkitty42 » Tue Apr 14, 2015 3:31 pm

Thorsten wrote in Mon Apr 13, 2015 11:48 am:Something visual... the joy of submodels :-) The separation dynamics isn't perfect yet, but perhaps the external force can be applied to simulate the effect of the separation motors pushing the boosters away from the stack.

i always thought there was some sort of side rockets that were fired to push the tops of the SRBs out sideways away from the orbiter and tank... something that made them kinda peel off away from the vehicle like drawing the top arcs of a valentine where the vehicle is the center V of the top of the valentine...

i hope that comes across visually as i'm seeing it in my mind's eye...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6401
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Space Shuttle

Postby Thorsten » Tue Apr 14, 2015 3:37 pm

Yes, as I said, I haven't implemented the separation dynamics yet.
Thorsten
 
Posts: 11604
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby wkitty42 » Tue Apr 14, 2015 3:42 pm

ahhh, ok... i did see that but didn't realize that this was what you were speaking of ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6401
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Space Shuttle

Postby Thorsten » Thu Apr 16, 2015 9:01 am

Converted the SRBs to slaved ballistic submodels with the flames attached. Upon separation, they're pushed away by 1.2 second burns of the 16 separation motors. Took a while till I found the specs of the separation motors, but okay...

The SRBs continue to burn for a bit without producing much in terms of thrust - they seem to fall here, but they actually don't, it's just that the shuttle accelerates away, if you switch off main engines at separation, you can nicely coast upwards with them.

Getting the directions of the external forces right based on shuttle yaw, pitch and roll frankly is a nightmare in trigonometry - you end up with some asin(cos(rho) / (cos(asin(sin(rho) * cos(theta)))) expressions.

Image

Image

That now looks like the right separation dynamics.

Only problem - the damn submodels flicker occasionally and vanish from view. Anyone who has experience with slaved ballistic objects and can comment?

So I might initialize them as ballistic objects but replace their visuals by a static model during ascent eventually.
Thorsten
 
Posts: 11604
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 1:14 pm

So I might initialize them as ballistic objects but replace their visuals by a static model during ascent eventually.

I have no comment on why or if there is a fix for the flicker. But I can confirm when I tried to animate an independent AI model in real time alongside a standard model, I had the same problem. If I used a sub-model (without animation) and then a ballistic for the animation, I achieved the desired effect without flicker or teleporting. However the ballistic animation has a mind of its own. I don't think you have much control over its departure.

I'd be real interested if there is a fix for the sub-model real-time animation?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5525
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Space Shuttle

Postby Hooray » Thu Apr 16, 2015 1:18 pm

wlbragg wrote in Thu Apr 16, 2015 1:14 pm:
So I might initialize them as ballistic objects but replace their visuals by a static model during ascent eventually.

I have no comment on why or if there is a fix for the flicker. But I can confirm when I tried to animate an independent AI model in real time alongside a standard model, I had the same problem. If I used a sub-model (without animation) and then a ballistic for the animation, I achieved the desired effect without flicker or teleporting. However the ballistic animation has a mind of its own. I don't think you have much control over its departure.


if that's the case, it must be something that the AI and sub-model code have in common, right ?
flickering and visibility changes could be related to mis-behaving LOD management in the underlying C++ code - but we'd need to look a thorough look at the C++ to see what is going on there.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11782
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 2:21 pm

I had this problem before I knew anything about autopilot or property rule. I never tried to apply that, (if you even can), to the animation. Maybe that could do the trick.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5525
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Space Shuttle

Postby Hooray » Thu Apr 16, 2015 5:44 pm

is the animation stuff otherwise handled from Nasal or why do you think that using property rules may be beneficial ?
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11782
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 5:56 pm

In my case, yes, I was handling it in nasal VS ballistics in XML.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5525
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Space Shuttle

Postby Hooray » Thu Apr 16, 2015 6:27 pm

and did that make a difference WRT flickering ??
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11782
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 9:08 pm

Now that I think about it, I could never get the AI model to animate from point a to b without teleporting (moving it by updating it in nasal). So I cheated and hid the AI model as soon as I connected to it with the hook or rope and used an AI ballistic sub-model when I needed to transport the cargo container from a to b. So I had to have both the AI container and a ballistic sub-model container. It was difficult to manipulate the physics of the sub-model the way I wanted to for towing it hanging from a rope. But I DIDN'T have flicker or teleporting if I used the ballistic sub-model. When I was ready to drop the container I used ballistics code. As soon as it hit the ground I switched back to the real AI model. It really was seamless looking, it was just disappointing I couldn't move it real time.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5525
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Space Shuttle

Postby Hooray » Fri Apr 17, 2015 12:44 am

have you tested Red Leader's scripted AI missiles framework (implemented on Nasal, check the wiki) ? I haven't noticed any such restrictions there back when I played with it - but I may have missed something ... the underlying C++ code still is the AI model system.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11782
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 1 guest