Silverfrost Forums

Welcome to our forums

OpenGL

30 Aug 2022 6:23 #29311

Have an OpenGL app, want to enter header info to draw the graph. Existing info is: i=winio@('%sp%ww[No Border]%og(static)%1w', * 0,0,500,500.ctrl) CALL glBegin(GL_LINES) CALL glColor3f(1.0,1.0,1.0) CALL glLineWidth(0.0) C DRAW CURVE HERE CALL glVertex3f(XVAR(INDX1),YVAR(INDX1),ZVAR(INDX1)) CALL glVertex3f(XVAR(INDX1+1),YVAR(INDX1+1),ZVAR(INDX1+1)) CALL glEND() ARRAY INFO IN XVAR, YVAR, ZVAR

THE WINDOW IS DISPLAYED ALRIGHT BUT DATA APPARENTLU OUT OF THE BORDERS, NOT SURE OF SOLUTION

PLEASE ADVISE, Sid Kraft

31 Aug 2022 11:11 #29313

Sid, you have posted just a fragment of code, and it is rarely possible to give you advice on how to fix problems unless we can see the variable declarations, etc.

Secondly, you posted the code directly in your message text, instead of using a code block or providing a download link for the code. As a result, the code is mangled (leading blanks are significant in fixed form Fortran source, and have been stripped out).

The second line that you showed contains a token that is not valid in Fortran: 500.ctrl. With that error, the compiler would not even have produced an OBJ file, so there is no question of linking and running the code as shown.

31 Aug 2022 1:49 #29314

mercej4: Maybe code below will be more definitive on the subject,

The input file contains real numbers, x, y, z and a control number, I format. All that is output in the display 'window' is blank, the curve is not displayed, maybe 'off' of the display area, not sure. This program did work at one time but tried recently and no curve output? Also, not sure windows display parameters, i= --- may not be correct but not sure as I do not have a reference document or? on the parameters that SilverFrost Fortran uses for OpenGL, any reference available?

Sid Kraft

    PROGRAM Simple
    INCLUDE <clearwin.ins>,nolist
    INCLUDE <opengl.ins>,nolist
    CHARACTER*1 ABUFFER(80)
    REAL*8 VECTR1, XXVAR, YYVAR, ZZVAR, XVAR(800), YVAR(800),
  *  ZVAR(800), XEND, YEND, ZEND
    REAL t1,t2
    INTEGER i, ctrl, IPLTCD, ICNTRL, IPEN
    i=winio@('%es%ca[Simple OpengGL Sample]&amp;')
    i=winio@('%sp%ww[no_border]%og[static]%lw',
  *         0, 0, 500, 500, ctrl)
     ICNTRL=0
     INDX1=1
     VEC1=0.D0
     VEC2=0.D0
     VEC3=0.D0
     IPEN=0

C OPEN THE INPUT FILE, GENERATED FROM PLOT/MATH
OPEN(UNIT=5,FILE='C:/Parsource_test/PARPLT.TXT') 100 IF (ICNTRL .EQ. 0) GOTO 200 C OTHER THAN FIRST RECORD, READ SUBSEQUENT, LOAD BUFFER 125 READ(5,150,END=1010) XXVAR, YYVAR, ZZVAR, VEC1, VEC2, VEC3,
* IPEN,(ABUFFER(I),I=1,4) 150 FORMAT(6F9.4,I4,4A1) XVAR(INDX1)=XXVAR YVAR(INDX1)=YYVAR ZVAR(INDX1)=ZZVAR INDX1=INDX1+1 IF (IPEN .EQ. 999) GOTO 1010 GOTO 125 200 READ(5,1000)IPLTCD, VECTR1, (ABUFFER(I),I=1,68) ICNTRL=1 1000 FORMAT(I4,F10.4,68A1) GOTO 125 1010 CONTINUE INDX1=1 CALL glScalef(1,1,1) CALL glBegin(GL_LINES) CALL glColor3f(1.0,1.0,1.0) CALL glLineWidth(0.0) C CHECK FOR END OF FILE, ALL ZERO 1020 XEND = XVAR(INDX1) YEND = YVAR(INDX1) ZEND = ZVAR(INDX1) IF (DABS(XEND+YEND+ZEND) .LT. 1.D-5) GOTO 1900
C DRAW THE SEGMENT AND CONTINUE CALL glVertex3f(XVAR(INDX1),YVAR(INDX1),ZVAR(INDX1)) CALL glVertex3f(XVAR(INDX1+1),YVAR(INDX1+1),ZVAR(INDX1+1)) INDX1=INDX1+1 C GET NEXT SEGMENT GOTO 1020 1900 CALL glEND()
END [/code]

1 Sep 2022 12:31 #29315

Sid, you added the tag '[/code]' at the end, but left out the matching '[code]' tag at the beginning, so the lines of code continue to have the same problem as before.

In order for someone to run the code, the data file (the one that you used or something shorter but sufficient to reproduce the display problem that you described) will be needed.

3 Sep 2022 12:32 #29316

mercej4: Not that familiar with using this system to post issues, is it possible to edit a note and also, can I attach a file to a note already created? Please let me know, the way that I attached the program listed was to use the Win 10 Snip and Attach utility but there must be a way to add a link directly. Sid Kraft

3 Sep 2022 12:54 #29317

The Silverfrost forums to not allow attachments, and they limit messages to about a hundred lines. We can get around these limitations by using a cloud file service.

There was a very similar situation in another thread, so I ask you to follow the suggestions given in that thread:

 https://forums.silverfrost.com/Forum/Topic/4152&amp;highlight=zip+dropbox+onedrive
4 Sep 2022 11:17 #29318

Sid, I know the first time everything is confusing, second time it looks reasonable and third time primitive 😃. This is psychology. And also psychology is that to explain things best way the two parents/coaches/teachers needed. Let me try.

Do you see [/ code] at the end of your post? (to show you this word i intentionally added space to it, you will not need to add this space). Edit this post and add the same word code in squared brackets AT THE BEGINNING OF YOUR PROGRAM. This pair of words are the HTML formatting codes. This is what mecej4 asks you to do. Just add this word in squared brackets and your source code will look like it has to be

Otherwise do the following: 1)Start your post again. Write some text and when you need to post some your program 2)click on the word 'Code' (see these words on top of this window Quote, Code, List, Img, URL?), you will see that this word in squared brackets will be added to your text automatically 3)Paste by using Ctrl+V your code (preliminary saving it into clipboard by highlighting it in your editor and clicking Save or pushing on keyboard Ctrl+C) 4)Again click on work 'Code', this word with slash and in brackets will be added to your post automatically

7 Sep 2022 7:10 #29342

How is below?

[/code] PROGRAM Simple INCLUDE <clearwin.ins>,nolist INCLUDE <opengl.ins>,nolist CHARACTER1 ABUFFER(80) REAL8 VECTR1, XXVAR, YYVAR, ZZVAR, XVAR(800), YVAR(800),

  • ZVAR(800), XEND, YEND, ZEND REAL t1,t2 INTEGER i, ctrl, IPLTCD, ICNTRL, IPEN i=winio@('%es%ca[Simple OpengGL Sample]&') i=winio@('%sp%ww[no_border]%og[static]%lw',
  • 0, 0, 500, 500, ctrl) ICNTRL=0 INDX1=1 VEC1=0.D0 VEC2=0.D0 VEC3=0.D0 IPEN=0 C OPEN THE INPUT FILE, GENERATED FROM PLOT/MATH OPEN(UNIT=5,FILE='C:/Parsource_test/PARPLT.TXT') 100 IF (ICNTRL .EQ. 0) GOTO 200 C OTHER THAN FIRST RECORD, READ SUBSEQUENT, LOAD BUFFER 125 READ(5,150,END=1010) XXVAR, YYVAR, ZZVAR, VEC1, VEC2, VEC3,
  • IPEN,(ABUFFER(I),I=1,4) 150 FORMAT(6F9.4,I4,4A1) XVAR(INDX1)=XXVAR YVAR(INDX1)=YYVAR ZVAR(INDX1)=ZZVAR INDX1=INDX1+1 IF (IPEN .EQ. 999) GOTO 1010 GOTO 125 200 READ(5,1000)IPLTCD, VECTR1, (ABUFFER(I),I=1,6Cool ICNTRL=1 1000 FORMAT(I4,F10.4,68A1) GOTO 125 1010 CONTINUE INDX1=1 CALL glScalef(1,1,1) CALL glBegin(GL_LINES) CALL glColor3f(1.0,1.0,1.0) CALL glLineWidth(0.0) C CHECK FOR END OF FILE, ALL ZERO 1020 XEND = XVAR(INDX1) YEND = YVAR(INDX1) ZEND = ZVAR(INDX1) IF (DABS(XEND+YEND+ZEND) .LT. 1.D-5) GOTO 1900 C DRAW THE SEGMENT AND CONTINUE CALL glVertex3f(XVAR(INDX1),YVAR(INDX1),ZVAR(INDX1)) CALL glVertex3f(XVAR(INDX1+1),YVAR(INDX1+1),ZVAR(INDX1+1)) INDX1=INDX1+1 C GET NEXT SEGMENT GOTO 1020 1900 CALL glEND() END [/code]
8 Sep 2022 8:10 #29346

See you have two the same HTML command symbols [/code] in front and end of your text?

Remove the extra slash in the first [/code] and all will be ok. The slash in all HTML codes means the end of the code, you have two ends and no beginning. When you remove it this command pair of HTML symbols will disappear and the text will look like it was intended

Same will be if you will need to insert an image or quote or URL, you start [image] or [quote] or [url], and after you insert the http address you finally always have to end that with the same keywords with the slash

Please login to reply.