Board index FlightGear Development Spaceflight

Space Shuttle

Discussion about development and usage of spacecraft

Re: Space Shuttle

Postby Hooray » Mon Apr 13, 2015 2: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Space Shuttle

Postby Thorsten » Mon Apr 13, 2015 12:48 pm

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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle

Postby Bjoern » Tue Apr 14, 2015 3: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: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: Space Shuttle

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

Thorsten wrote in Mon Apr 13, 2015 12:48 pm: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: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Space Shuttle

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

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

Re: Space Shuttle

Postby wkitty42 » Tue Apr 14, 2015 4: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: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Space Shuttle

Postby Thorsten » Thu Apr 16, 2015 10: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 2: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Space Shuttle

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

wlbragg wrote in Thu Apr 16, 2015 2: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 3: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Space Shuttle

Postby Hooray » Thu Apr 16, 2015 6: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Space Shuttle

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

In my case, yes, I was handling it in nasal VS ballistics in XML.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Space Shuttle

Postby Hooray » Thu Apr 16, 2015 7: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Space Shuttle

Postby wlbragg » Thu Apr 16, 2015 10: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Space Shuttle

Postby Hooray » Fri Apr 17, 2015 1: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 5 guests