Board index FlightGear Development Aircraft

Immatriculation  Topic is solved

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Immatriculation

Postby unrealaviation » Sat Jun 29, 2019 2:13 pm

Is there any way to change the colour of the letters?
Big, bold black is a bit OTT...
unrealaviation
 
Posts: 37
Joined: Sat Dec 16, 2017 12:30 am

Re: Immatriculation  

Postby wlbragg » Sat Jun 29, 2019 2:51 pm

Yes, in the file folder structure for the immatriculation there are already black and white PNG file lettering. I suppose you could add other colors. It might require some minor changes to the code to use the additional colors.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4989
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Immatriculation

Postby wlbragg » Sat Jun 29, 2019 2:55 pm

You could also write a new system using canvas instead of ac's and png's.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4989
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Immatriculation

Postby unrealaviation » Sat Jun 29, 2019 6:57 pm

Aah, that pointed me in the right direction.
In the end I added a teeny bit of transparency to the DefaultWhite entry in the immat.ac file. Changed trans from 0 to 0.3 which made the black more of a dark grey and took away the superimposed look. I am happy with it.

Thanks.
unrealaviation
 
Posts: 37
Joined: Sat Dec 16, 2017 12:30 am

Re: Immatriculation

Postby Hooray » Sat Jul 06, 2019 11:15 am

wlbragg wrote in Sat Jun 29, 2019 2:55 pm:You could also write a new system using canvas instead of ac's and png's.


check the wiki, look for "canvas liveries"
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Immatriculation

Postby abassign » Sat Jul 06, 2019 4:08 pm

unrealaviation wrote in Sat Jun 29, 2019 2:13 pm:Is there any way to change the colour of the letters?
Big, bold black is a bit OTT...


In G91R1 we did all the liveries with canvas. It's not easy, but they work very well and, once loaded, they have the same features as the standard liveries. In some respects it is very similar to standard liveries, only for uploading it is necessary to use a NASAL script. Unfortunately, at least for now, it does not seem possible to directly use XML as is done for the environment. It would be very nice to complete the loading of the canvas with XML commands, maybe someone is already thinking about it, but I haven't seen anything, so I can't tell you about this.

I was asked to write a how-to to better explain how to activate a livery with canvases. I hope soon to have time to think about it as I believe it is very useful. It took a lot of tests and attempts to understand how it worked. However, I give you some references to the files you can watch. You will notice then that for the FIAT G91R1B it is possible to change livery through an XML configuration file that identifies the loaded liveries and their variants.

The FIAT G91R1B repository:
https://github.com/abassign/G91-R1B_HD

The NASAL Script for livery activation:
https://github.com/abassign/G91-R1B_HD/blob/master/Models/Liveries/set_livery.nas

Given the complexity of the aircraft, many objects have been defined that are listed in the first part of the NASAL file and that are activated with the command, for example:

Code: Select all
ca = canvas.new({"name": "Fuselage",
                        "size": [ca_size,ca_size],
                        "view": [ca_size,ca_size],
                        "mipmapping": 1});


Defines the size of the livery and is obtained from a configuration file, in our plane it is possible to change the size of the livery. This allows you to be able to define very large liveries even from 16K! (which I tried and work! only for 8GB video cards up). If you use a small livery, for example 1024 (1K), you can run the aircraft on less powerful machines.

The second important thing in NASAL is to add the various objects to the canvas via the function:

[url]ca.addPlacement({"node": "A__G91_fuselage_int.weapon.door.001"});[/url]

For the rest I suggest you follow the code which I hope is clear enough. Obviously if you have problems write me that I answer you.

For a possible normal map it is necessary to execute a declaration, this is done for example with this command:

Code: Select all
<effect>
        <inherits-from>Aircraft/G91-R1B_HD/Models/Liveries/liveries_001</inherits-from>
        <object-name>A__G91_fuselage_int.weapon.door.001</object-name>


You can see the effect here:
https://github.com/abassign/G91-R1B_HD/blob/master/Models/Liveries/liveries_001.eff
and it's pretty standard. Unfortunately the normal-map is not managed by the canvas (maybe I'm wrong, but if anyone knows how it's possible it would be very interesting)

I have tried, with success, to insert in a object a canvas with SVG image or vector objects or texts. This type of canvas allows you to insert something similar to the delcas and therefore obtain very interesting dynamic variations. I think that's what you want to do. But I recommend a trick ...
If you want to insert an animated canvas, first define an object (which I call a tray) on which to place the object! The tray can be placed above the surface at 1/10 mm ... The best thing about this solution is that it is possible to use a resolution for the tray much greater than that used for the fuselage. For example, you can make a hypothetical 1024x1024 resolution tray, but with a size, for example, of 100x100 mm. This means that a text is read very well up close, even if the resolution of the livery is low!

You can do it even on a traditional livery just define the tray separate from the livery.

Problem

When you use the multi user you can't run the NASAL code for the remote aircraft and therefore you don't see the canvas liveries or even the canvas objects! This is why I hope someone produces an XML command that associates a canvas
abassign
 
Posts: 823
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: Immatriculation

Postby Hooray » Sun Jul 07, 2019 10:25 am

depending on what you have in mind for Canvas liveries without explicitly adding Nasal code to your XML file, you could serialize the corresponding Canvas to a props.Node object, and then dump() the whole tree to a PropertyList-XML file.

Obviously, this won't handle dynamic features, i.e. no Nasal callbacks (timers/listeners) - but a livery consisting of just textures and conventional canvas elements (path, text, image) should just work "as is".

You would probably want to use an fgcommand or include directive, because canvas index may differ across instances/invocations. But otherwise, you can definitely serialize a Canvas structure to an XML file.

A while ago, I used a similar mechanism to replicate canvas textures across multiple fgfs instance over telnet (props)
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Immatriculation

Postby unrealaviation » Tue Sep 10, 2019 7:27 pm

In the end, the first suggestion of editing the colours turned out to be the best one.
I have had some nice results matching colours with a part of the livery... The second suggestion of additional code to achieve this has defeated me for now. :-/

Thanks folks.


Kev
unrealaviation
 
Posts: 37
Joined: Sat Dec 16, 2017 12:30 am


Return to Aircraft

Who is online

Users browsing this forum: MSN [Bot] and 2 guests