Canvas Textures
Re: Canvas Textures
Yes, the canvas feature has been a huge improvement introduced in AM v3.x (remember my lame attempt at an interim graphic library anyone?) thanks Corjan!
It is not a real war TBH, As said previously, the key here is « the right tool for the right task ».
Jacques
It is not a real war TBH, As said previously, the key here is « the right tool for the right task ».
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Jacques,
Some nice work bud.
@Corjan Jacques and I have an understanding and all this is for the benefit of all peeps to get an Idea of what can and cannot be done on each approach. Both approaches have their pro's and cons. This will give peeps an idea of when to use what approach. Yes we are spoiled and can mix and match.
Just have to get this one in Is 3D on the radar anytime soon?
I am sure both of us would love that.
Keith
Some nice work bud.
@Corjan Jacques and I have an understanding and all this is for the benefit of all peeps to get an Idea of what can and cannot be done on each approach. Both approaches have their pro's and cons. This will give peeps an idea of when to use what approach. Yes we are spoiled and can mix and match.
Just have to get this one in Is 3D on the radar anytime soon?
I am sure both of us would love that.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Hi
I have been thinking about switch shadows and a hack towards 3D .
Having done some work regarding maps and the manipulation of data this is possible. Expensive though.
@Corjan I do not want to spend weeks on this if there is something coming soon.
I have something in mind and will work on it.
I suppose that the graphic data from the sim frame needs to be had some how? Is that data available?
Keith
I have been thinking about switch shadows and a hack towards 3D .
Having done some work regarding maps and the manipulation of data this is possible. Expensive though.
@Corjan I do not want to spend weeks on this if there is something coming soon.
I have something in mind and will work on it.
I suppose that the graphic data from the sim frame needs to be had some how? Is that data available?
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Peeps i am inquisitive, and <Canvas Textures> is not far of the challenge to create shadows and graphic movement.
I can manipulate a polygon within canvas_draw() to simulate a switch and a fixed shadow. Even stretch or compress.
I am just thinking here @Corjan , From an automation point of view. A camera function.
This camera function could be... Manipulation of the node.
I think this could work.
The node is added to the... camera_id=camera_add(node_id..)
effects would need to be along the lines of turnstile, roller etc....
Keith
I can manipulate a polygon within canvas_draw() to simulate a switch and a fixed shadow. Even stretch or compress.
I am just thinking here @Corjan , From an automation point of view. A camera function.
This camera function could be... Manipulation of the node.
I think this could work.
The node is added to the... camera_id=camera_add(node_id..)
effects would need to be along the lines of turnstile, roller etc....
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Hi,
Here you go @JackZ Something you will love.
Keith
Here you go @JackZ Something you will love.
Keith
Code: Select all
my_canvas=canvas_add(0,0,500,200)
canvas_draw(my_canvas, function()
_rect(0,0,500,200)
_fill("yellow")
_circle(15,15,15)
_fill("red")
_rect(0,80,350,80)
_fill_img("switch_small_down.png",0,80,350,80)
end)
val1=10
val2=5
function dial_callback(dir)
val1=val1+(dir*20)
val2=val2-(dir*10)
canvas_draw(my_canvas, function()
_rect(0,0,500,200)
_fill("yellow")
_circle(15,15,15)
_fill("red")
_rect(0+val2,80,350+val1,80)
_fill_img("switch_small_down.png",0+val2,80,350+val1,80)
end)
end
my_dial=dial_add(nil,0,0,30,30,dial_callback)
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Hi,
It might be that this concept could be used to create a joy stick. ??
Keith
It might be that this concept could be used to create a joy stick. ??
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Canvas Textures
Hi Keith,
What about a different approach ?. If the switch visible area is a 'view window', then could you not use a strip image with a long series of fixed progressive switch images for the movement and then progress that 'strip' image behind the window ?. Done at the appropriate speed it would give you a progressive movement view of the switch change. - or a rotary disk - whatever.
It is the same idea as the old 'flipbook animation' used more than 150 years ago (some historical example go back more than 600 years) only that the changing images would be on a strip or circular continuous png that was moved along - or 'around' behind the view window.
https://en.wikipedia.org/wiki/Flip_book
try a quick search on flipbook animation on YT for examples. It would be the same principle with a strip of images that were stepped along in a way that would be one frame per step.
I believe there are even on line tools that can create progressions --
Joe.
What about a different approach ?. If the switch visible area is a 'view window', then could you not use a strip image with a long series of fixed progressive switch images for the movement and then progress that 'strip' image behind the window ?. Done at the appropriate speed it would give you a progressive movement view of the switch change. - or a rotary disk - whatever.
It is the same idea as the old 'flipbook animation' used more than 150 years ago (some historical example go back more than 600 years) only that the changing images would be on a strip or circular continuous png that was moved along - or 'around' behind the view window.
https://en.wikipedia.org/wiki/Flip_book
try a quick search on flipbook animation on YT for examples. It would be the same principle with a strip of images that were stepped along in a way that would be one frame per step.
I believe there are even on line tools that can create progressions --
Joe.
Joe. CISSP, MSc.
Re: Canvas Textures
Nice one Keith. Interesting concept. Is the switch a png added to the canvas or is it all pure vector graphics.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Canvas Textures
Yes Tony,
It is a .png in a canvas. One could also manipulate a vector graphic in the same way.
@jph Thanks for the heads up. I will take a look.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Canvas Textures
Nice find @Keith Baxter !
I doubt it would be really useful for a switch or a joystick where the transition from one position to another is almost instant due to the spring loaded nature of the switch, so the good old image swap is still my favorite, but I sure could find usages for animation of this, maybe for shadows.
Will have to experiment
Jacques
I doubt it would be really useful for a switch or a joystick where the transition from one position to another is almost instant due to the spring loaded nature of the switch, so the good old image swap is still my favorite, but I sure could find usages for animation of this, maybe for shadows.
Will have to experiment
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ