forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenGL Animation Example - missing file 'danimate.ins'

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jun 20, 2018 1:08 am    Post subject: OpenGL Animation Example - missing file 'danimate.ins' Reply with quote

While investigating Sid's problem I came across and tried to compile the documented OpenGL example here:
https://silverfrost.com/ftn95-help/clearwinp/opengl/animationandmultiplewindows.aspx

It fails because the INCLUE-ed file 'danimate.ins' doesn't exist.
I searched for it in both the ftn95 installation directory and also in the ftn95Examples directory, but no luck finding it.

Any idea where it is Paul ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Wed Jun 20, 2018 7:29 am    Post subject: Reply with quote

It looks like this file has got lost. I can't find it on my machine.

A probable reconstruction for danimate.ins is

Code:
      logical window1_active,window2_active,do_draw(2)
      integer devicecontext(2),renderingcontext(2)


The program fails to run correctly and the runtime message is "No OpenGL buffers are open".

I am guessing that the program ran correctly when it was written but that OpenGL has moved on since then. I will make a note that this needs to be investigated.

OpenGL samples that did run (last time I tested them) can be found in C:\Users\YourName\Documents\FTN95 Examples\OpenGL, assuming you use the C drive and you have installed the standard samples.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jun 20, 2018 8:57 pm    Post subject: Reply with quote

thanks Paul

I'd checked in the examples directory so saw all those other examples.
I shall give them a try as and when I get time.

Just one point, I'm sure there are many folk who don't even know that the examples directory is put there.
Maybe it would be agood idea to modify the program install for future releases so that the user is prompted (as to where the files will be put) and given the option to specify a different directory.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 248
Location: Matlock, Derbyshire, UK

PostPosted: Fri Apr 26, 2024 4:45 pm    Post subject: Reply with quote

I also hit the buffers with a missing danimate.ins.
As for the OpenGL examples, these mostly have 1998 date stamps. build.bat is March 2009, and animate.for is July 2019. And that is it.

However, that animate.for doesn't include danimate.ins but it does have a common block

logical do_draw
common /animate_com/ do_draw

Maybe that is all that is needed.

.... and wow - does it animate! - a rotating slab. Makes my eyes go funny. It's either too fast or too slow, but it does rotate. Now to try the other example.

For that one, Paul's supposition seems to be correct:
logical do_draw(2),window1_active,window2_active
integer devicecontext(2),renderingcontext(2)
common /animate_com/ do_draw,devicecontext,renderingcontext,
1 window1_active,window2_active
but I found one or two minor typos in the code. However, the program runs. It doesn't animate but it does open and display two windows.Graphs on a blue background.
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Sat Apr 27, 2024 11:28 am    Post subject: Reply with quote

Steve

I have had a quick look at this. I can see two "animate" samples, one with the caption "Double buffering", the other with the caption "Rotating Slab".

Both use double buffering. The first works, the second fails with "No OpenGL buffers are open".

The only thing that I noticed was that, for 64 bits, the device contexts need to be INTEGER(7).

Code:
      integer(7) devicecontext(2),renderingcontext(2)


But I don't know why it is failing.
Back to top
View user's profile Send private message AIM Address
silicondale



Joined: 15 Mar 2007
Posts: 248
Location: Matlock, Derbyshire, UK

PostPosted: Sat Apr 27, 2024 12:01 pm    Post subject: Reply with quote

Paul -Yes, there are two examples.

(1) in the examples folder, which works - I think this is the one that we have both managed to run.

(2) different coding, from the Silverfrost website. https://www.silverfrost.com/ftn95-help/clearwinp/opengl/animationandmultiplewindows.aspx
This is the one that wants danimate.ins - which I have replaced by the common block I posted. I compiled in 32-bit. It didn't need integer(7), and it ran without any problems. However, it only displayed two static windows, no animation.

All I wanted was to test whether OpenGL would possibly be of any use to me.

What I am actually working on is image processing - de-noising a series of images extracted from videos generated by submersible robots in water of varying degrees of murkiness. So I don't need animation at this stage. Only if I get good de-noising results will I (possibly) want animation to reconstruct the videos - though then it's probably easier just to use an off-the-shelf product to string all the frames together.

------------------------------------------------------
UPDATE 27/4 at 14:35
I now have the second program working. Two windows, both animated. Need to include the following in subroutine display and in mainline:
double precision spin,spin_array(2)
common/display_com/spin,spin_array
(not sure if spin_array is needed in the common block but it would allow setting the rotation at different speeds in the two windows).
Need also to add
spin=spin+2d0
after the call glFlush line in subroutine display.
When running the program, left mouse clisk starts the spin, right mouse click stops it, in each window separately.

It looks to me like the website example is a "work in progress" Wink
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Sat Apr 27, 2024 4:29 pm    Post subject: Reply with quote

Steve,
OpenGL is mostly for 3D imaging. No sure what this will give you with your images which are inherently 2D... Still with OpenGL even 2D stills will probably look more attractive.

I denoise my 3D OpenGL data and images out of it pretty often. PIC codes data is noisy like hell.

What i miss in Silverfrost graphics library is the facility to make AVI video out of jpg/png stills we can make out of OpenGL images. Such video making facility is a must for modern presentations. MATLAB has it by the way. So for presentations i have to use the working OpenGL code which creates and animates images in real time which i manipulate manually from the keyboard. But sometimes the data sets are very large and the animation looking slow. Of course you almost can not run the FTN95 code from flash drive on someones machine (conference presentation videoprojector) and have to use your own computer/laptop ;(

It is possible to load still JPGs into third-party software, or make your own animation code showing JPGs in sequence (i did that with FTN77 32 years ago). Or we can send them into online animation server but this does not look super-duper, your code must do video files itself
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 248
Location: Matlock, Derbyshire, UK

PostPosted: Sat Apr 27, 2024 5:01 pm    Post subject: Reply with quote

Dan -

Indeed so - though ultimately, as the robot follows a curved path, these 2D images should map to 3D point clouds which can then be viewed in 3D. Stitching multiple images together is a different problem of course! I use Agisoft Metashape for photogrammetry, and it does quite a good job, but I'd like to exercise a bit more control over the algorithm. I have a couple of colleagues (in Austria and Bulgaria) who have done a lot of work on the video generation, but although the results are very good, they don't do the de-noising. I have also tried the AVCLabs video de-noiser but it smoothes the data far too much. My comproise solution may be to send them a bunch of de-noised JPG files and leave it to them to build the videos, with some in-betweening if necessary.

Anyway, as for OpenGL, I've probably taken this as far as I need to for now. I've tried the examples, made them work, and am pleased with the results. Banking that!
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group