Project WIN Ascension Ultra BETA test thread

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Yeah, I'm using transparency to do most of the work and keep the polys down. Each tress is 36 polys.
palmmesh.png


This is the first draft, so not perfect. The texture needs some work too, but we're just going to test the transparency (wrt z buffer issue) first and see if it's good enough to implement. But I'm hopeful.
edit: I'll prob want to add a few more polys, to at least make the shadow more spikey... assuming I stick with a palm style tree of course.
 

Screamer7

Member
Joined
Sep 14, 2011
Messages
474
Reaction score
20
Points
18
Location
Virginia FS
It is looking very good WAP. I like the design of the airport terminal.:thumbup:
You're creativity does not know any bounds.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
You're creativity does not know any bounds.
Don't know about that, but my motivation and time-keeping apparently does lol... but we're getting there slowly!

---------- Post added 21-12-12 at 18:09 ---------- Previous post was 20-12-12 at 23:19 ----------

I should probably be posting about new stuff in the original dev thread, rather than the BETA test thread.... So this will be the last development post in this thread, I'll switch back to the dev thread and leave this one for purely beta test related chatter.

I worked more on the trees today. A new texture and double the polys have produced this, which I think is much more pleasing to the eye.
au44.png
 

PennyBlack

Altea Development Team
Addon Developer
Joined
Jun 17, 2010
Messages
713
Reaction score
5
Points
0
Location
Infront of my PC
Website
pennyblack.yolasite.com
This is an epic addon.

I like the way the tree was produced, that's made me buzz because everything tried had high polys. I'm going to try that way for trees in my domes.
Nice touch.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
This is an epic addon.

I like the way the tree was produced, that's made me buzz because everything tried had high polys. I'm going to try that way for trees in my domes.
Nice touch.

Cheers PB, much appreciated.

A word on this use though... The dreaded Z buffer. You will likely encounter transparency issues with this, namely what can and can't be seen through transparent textures.

Face has got around the worst of the z buffer issue by loading all the transparent components of the base last. Which means I have had to separate all the windows(and trees)from my meshes into separate meshes to be loaded after all the none-transparent parts. This works to an acceptable level but isn't perfect. But it's the best workaround for the dx7 limitations. One day, with the _ng clients it won't be an issue, but for now you will have to bear it in mind when you use this tree technique
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Another apology for no Xmas release!

I have been away and Face was hindered by the RL beast. So we'll have something as soon as Face can find the time to hit our current release targets. Which should be soonish I hope, but RL always comes first as you know.
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Take your time.

One thing I noticed yesterday that I figured I might want to report... the tracking RADAR dishes that track you on approach have no limit to their turning velocity. If you fly by them really closely at high speed, they'll just flip over in an instant.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Take your time.

One thing I noticed yesterday that I figured I might want to report... the tracking RADAR dishes that track you on approach have no limit to their turning velocity. If you fly by them really closely at high speed, they'll just flip over in an instant.

Yeah I had noticed that myself, we've just used the code as it was from cssc. So I don't know how easy it is to cap the rotation speed, since I think it simply points along the given vector, rather than actually rotating towards that vector. I'll see if face et al can shine light on the code.
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Mathematically it's not difficult. Instead of pointing right to the Desired direction (direction from the dish to the target), calculate how much the dish can turn in the given time frame from Current direction to Desired direction, then point it there instead. In the next frame, the Desired direction is again updated. If the Desired direction doesn't change too much (target is far away from dish, moving slowly or moving away or towards the dish), the dish will eventually catch up.

The math behind it is simple. The dish can rotate around a vertical axis, which gives you one angle and around a horizontal axis to point up and down, which gives you the second angle. The rotation rate of each of these two can be capped individually.

You then calculate the angle difference in the vertical axis and the horizontal one. Best done in Horizontal frame of reference. If d is distance from the dish to target and a is the relative altitude (altitude of target - altitude of dish), then the vertical angle difference (angle around horizontal axis) can be expressed as

Alpha = ArcSin[a / d]

Let Beta be the angle the dish is currently pointing at. If w is the maximum angular velocity of the dish around the horizontal axis, then w * delta-t gives you the maximum it can possibly travel in this time frame. If that angle is lower than than the angle difference abs(Alpha - Beta), then the dish can be turned directly towards the target. If not, it has to be turned into the direction Beta + sign(Alpha - Beta) * w * delta-t.

The function sign returns 1 if the argument is positive or 0 and -1 if the argument is negative.


Rotation around vertical axis is similar:
Let Delta be the current angle the dish is pointing at (with 0 being north, Pi/2 being east).

If you get the relative position between the target and dish in the horizontal reference frame, then you can use the x and z components of the vector to figure out the desired direction the dish should be pointing at. z component points north and x points east, but it gets a bit tricky here. The desired angle Gamma is calculated as ArcTan[z / x], but be careful here! ArcTan[-z / -x] = ArcTan[z / x] and ArcTan[z / -x] = ArcTan[-z / x], so you'll get phantom results!

You can write your own code to return the correct heading, but if you want to use mine:
Code:
bool GetAirspeedHeading(OBJHANDLE Vessel, double &Heading)
{
	Heading = 0;

	if (!oapiIsVessel(Vessel))
	{
		return false;
	}

	VESSEL *VesselInterface = oapiGetVesselInterface(Vessel);
	VECTOR3 CurrentVelocity;

	VesselInterface->GetHorizonAirspeedVector(CurrentVelocity);

	if (CurrentVelocity.x > 0)
	{
		if (CurrentVelocity.z > 0)
		{
			Heading = atan(CurrentVelocity.x / CurrentVelocity.z);
		}

		else if (CurrentVelocity.z < 0)
		{
			Heading = PI + atan(CurrentVelocity.x / CurrentVelocity.z);
		}

		else
		{
			Heading = PI / 2;
		}
	}

	else if (CurrentVelocity.x < 0)
	{
		if (CurrentVelocity.z > 0)
		{
			Heading = (2 * PI) + atan(CurrentVelocity.x / CurrentVelocity.z);
		}

		else if (CurrentVelocity.z < 0)
		{
			Heading = PI + atan(CurrentVelocity.x / CurrentVelocity.z);
		}

		else
		{
			Heading = 3 * PI / 2;
		}
	}

	else
	{
		if (CurrentVelocity.z > 0)
		{
			Heading = PI;
		}

		else if (CurrentVelocity.z < 0)
		{
			Heading = 0;
		}

		else
		{
			Heading = 0;
		}
	}

	return true;
}

This bit of code returns the vessel's current heading - not nose direction, but heading of airspeed vector. It returns a number between 0 and 2 Pi. The most important bit is the giant if statement that handles the ArcTan function correctly. This is atan included in <math.h>

Anyways, now you have your desired angle Gamma and current angle Delta. If q is the maximum angular velocity around the vertical axis, then the dish can turn a maximum of q * delta-t in this frame. If the angle q * delta-t is smaller than abs(Gamma - Delta), then the dish can just snap to Gamma, if not, things get a bit complicated yet again.

You can't just use sign(Gamma - Delta) like you would before, because in cases where Gamma = 0 and Delta = 3/2 Pi - dish pointing west, target is due north - the dish would first turn south, then east, then north, turning an angle of 3/2Pi, instead of directly north, turning a Pi/2.

The bit of code that will give the correct direction is this:
Code:
double Direction = sin(DesiredHeading + ((2 * PI) - Heading));	

	if (DesiredHeading > Heading)
	{
		Direction = sin(DesiredHeading - Heading);
	}

If Heading is the current direction of the dish and DesiredHeading is where it needs to be pointed, then this bit of code will produce a number between -1 and 1. If the number is negative, then you need to turn the dish left (if it's pointing east, turn it towards north). If it's positive, turn it right. If it's 0, then the dish is either pointing right at it, or the target is right behind the dish.

So, now you have the change in angle you can do in this time frame and a direction you need to move towards. Then new angle should then be Delta + Sign(Direction) * q * delta-t.

Now you have the two angles required - Beta and Delta. Depending on how Face has the code set up, he'll either need to turn that back into a vector or not. It's easy enough to do that.


Face, if I was unclear anywhere let me know and I'll clarify.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,404
Reaction score
581
Points
153
Location
Vienna
Thanks for the idea, RisingFury. I guess I'll not have much time to look into that ATM, though.

You'd be welcome to contribute to the code base, if you've got working code already. The tracker class is in /Orbitersdk/samples/AscensionUltra/Tracker.* .

regards,
Face
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Thanks for the idea, RisingFury. I guess I'll not have much time to look into that ATM, though.

You'd be welcome to contribute to the code base, if you've got working code already. The tracker class is in /Orbitersdk/samples/AscensionUltra/Tracker.* .

regards,
Face

Ok, I can do that. I assume as a beta tester, I already have all the code and files needed to compile and test the code?
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,404
Reaction score
581
Points
153
Location
Vienna
Ok, I can do that. I assume as a beta tester, I already have all the code and files needed to compile and test the code?

Yes. You should also have full read access to the repository on Bitbucket, so it should be easy to clone your own copy and hack away. You could then send me a pull request (if you've got an account there already), or simply the patch/snapshot to get it into the repo. Just be aware that the license is GPL V2 or later, so your contribution will be under those terms.

regards,
Face
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Dish_fixed.jpg


I managed to modify the tracker code to give the RADAR dish limited rotation rate. The rotation rate is configurable in the Tracker.h file. I've sent the code to Face.

If you zoom past the dish, it no longer snaps to the other side at a very high rotation rate. In the image, the velocity of the DG is around 150 m/s.

With the current rotation rate that I set up, the dish tracks you on approach and tracks you when you flare up. It only begins to lag behind when you fly past it, but catches on after touchdown. Of course, the dish at the other end can track you constantly.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
I'm happy to help.

Another minor nitpick that you probably already know about, but is worth mentioning:

Nitpick.jpg
Good catch, I've never pressed F9 during dev.
I can't quite see what's going on there exactly, is it another word written over 'Wideawake', or some other anomaly? I'll take a look on my orbiter shortly.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,404
Reaction score
581
Points
153
Location
Vienna
It is a superimposing of vessel AND surface base names. The vessel is called "AU-Main" in the test scenario, and the surface base is "Wideawake Int(AU)". Orbiter allows to define what kind of labels are displayed in the Ctrl-F9 dialog.

If you start a scenario with the auto-spawn option, however, you'll get a vessel labelled just the same as the surface base, resulting in a weirdly shaking but readable superimposing if both vessel and surface base labels are activated.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,404
Reaction score
581
Points
153
Location
Vienna
Can we have one called 'Wide_____' and the other called '_____awake'...? ;)

:rofl:

Sure. But that wouldn't help the case where a user edits a scenario and calls the AU vessel 'NOT______' . ;)
 
Top