|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
stfark1
Joined: 02 Sep 2008 Posts: 222
|
Posted: Tue Aug 30, 2022 7:23 pm Post subject: OpenGL |
|
|
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 |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Wed Aug 31, 2022 12:11 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
stfark1
Joined: 02 Sep 2008 Posts: 222
|
Posted: Wed Aug 31, 2022 2:49 pm Post subject: OpenGL |
|
|
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]&')
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,6
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] |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Thu Sep 01, 2022 1:31 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
stfark1
Joined: 02 Sep 2008 Posts: 222
|
Posted: Sat Sep 03, 2022 1:32 am Post subject: OpenGL |
|
|
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 |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Sat Sep 03, 2022 1:54 am Post subject: |
|
|
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:
http://forums.silverfrost.com/viewtopic.php?t=4638&highlight=zip+dropbox+onedrive |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2865 Location: South Pole, Antarctica
|
Posted: Sun Sep 04, 2022 12:17 pm Post subject: |
|
|
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 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 |
|
Back to top |
|
|
stfark1
Joined: 02 Sep 2008 Posts: 222
|
Posted: Wed Sep 07, 2022 8:10 pm Post subject: opengl |
|
|
How is below?
[/code]
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]&')
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] |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2865 Location: South Pole, Antarctica
|
Posted: Thu Sep 08, 2022 9:10 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
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
|