Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Eric.Erpelding

#1
Hi erico.

My computer had Windows 10, build 10240 on it which is very old.
This is the version for which GLBasic v15.004 would raise an error.  (really it is v15.005 as listed in the Control Panel's list of programs)
The complete error message that was reported was:

QuoteProgram Files (x86)\GBasic_v15\EditorE.exe

Your Windows C-Runtimes have a serious bug! Please call FIDES, or install KB3118401.
Do NOT work with this product!

After upgrading Windows to version 1703, build 15063.632 I could start GLBasic without the error.

This shows it is always good to keep Windows 10 up to date!
#2
I should mention that the computer had not been connected to the internet in over a year.
Windows was certainly doing an update. After it is finished updating I will try starting v15 again.
#3
Hello Forum,

I just installed GLBasic v15 on a Windows 10 64-bit computer and when I started the program I got an error message window stating that there was a problem with the c-runtimes and to call FIDES or see KB3118401. The message ended by saying "Do not use this software"!

Has anyone else seen this?


#4
QuoteGlbasic wants an angle for sin and Cos functions dont know if it Works with Radians too
Yes, I discovered that when writing the program. I think DEG is the only angle mode in GLBasic.
#5
This is my first attempt at making a 3D representation of a revolving vector using GLBasic.
Actually, it is my first attempt at writing any kind of 3D graphics program.
The code is very simple and will be the basis for further development.
Specific parameter values have been hard coded into this version just to get something working.
Any comments will be appreciated.

Code (glbasic) Select
// --------------------------------- //
// Project: Revolving Arrow Vector
// Start: Sunday, August 21, 2016
// IDE Version: 14.001

GLOBAL cone, cylinder
GLOBAL phi

GLOBAL ArrowHeadColor, ArrowShaftColor

ArrowHeadColor=RGB(255,0,0)
ArrowShaftColor = RGB(255, 153,51)

// object numbers
cone = 0
cylinder=1

// CreateCone: num, r, h, n, col
CreateCone(cone,6,10,20, ArrowHeadColor)

// CreateCylinder: num, r, h, n, col
CreateCylinder(cylinder,3,50, 20, ArrowShaftColor)


WHILE TRUE
    INC phi, 1.
    X_MAKE3D 1,1000,45

    X_CAMERA 100,75,100, 0,25,0
   
    X_MOVEMENT 0,0,0
   
    // Draw co-ordinate axis
    X_LINE 0,0,0,100,0,0,5,RGB(0,0,255)
    X_LINE 0,0,0,0,100,0,5,RGB(0,0,255)
    X_LINE 0,0,0,0,0,100,5,RGB(0,0,255)
   
    // Draw rotated arrow vector
    X_ROTATION 45, COS(phi),0,-SIN(phi)
    X_DRAWOBJ cylinder,0
    X_MOVEMENT 50*COS(45)*SIN(phi),50*SIN(45),50*COS(45)*COS(phi)
    X_ROTATION 45, COS(phi),0,-SIN(phi)
    X_DRAWOBJ cone,0

    SHOWSCREEN
WEND

// ------------------------------------------------------------- //
// -=#  CONE  #=-
// ------------------------------------------------------------- //
FUNCTION CreateCone: num, r, h, n, col
LOCAL i,j,theta,pi
pi = ACOS(0)*2
IF r < 0 THEN r = -r
IF n < 4 THEN n = 4

X_AUTONORMALS 2
X_OBJSTART num
FOR i=0 TO n
theta = i * 2*pi / n;
X_OBJADDVERTEX   0, h, 0, 0, 0, col
        X_OBJADDVERTEX  r*COS(theta),0,r*SIN(theta),0,0,col
        theta = (i+1)*2*pi/n
        X_OBJADDVERTEX  r*COS(theta),0,r*SIN(theta),0,0,RGB(255,255,255)
        X_OBJADDVERTEX 0,0,0,0,0,col
        X_OBJNEWGROUP

NEXT
X_OBJEND
ENDFUNCTION

// ------------------------------------------------------------- //
// -=#  CYLINDER  #=-
// ------------------------------------------------------------- //
FUNCTION CreateCylinder: num, r, h, n, col
LOCAL i,j,theta,pi
pi = ACOS(0)*2
IF r < 0 THEN r = -r
IF n < 4 THEN n = 4

X_AUTONORMALS 2
X_OBJSTART num
FOR i=0 TO n
theta = i * 2*pi / n;
X_OBJADDVERTEX   r*COS(theta),0,r*SIN(theta),0,0,col
        X_OBJADDVERTEX  r*COS(theta),h,r*SIN(theta),0,0,col
        theta = (i+1)*2*pi/n
        X_OBJADDVERTEX  r*COS(theta),0,r*SIN(theta),0,0,col
        X_OBJADDVERTEX  r*COS(theta),h,r*SIN(theta),0,0,col
        X_OBJNEWGROUP

NEXT
X_OBJEND
ENDFUNCTION
#6
I wrote:
QuoteOne has to create a function containing INLINE code to call the sscanf function that will do the conversion.
I should have said that one "could" create a function that calls scanf from within INLINE code.

Of course, as has been pointed out by previous posters, one can create a FUNCTION containing pure GLBASIC code that will do the same Hex to Dec conversion.
#7
I found it!
Tools->Options

The RGB Color Codes Chart web page given in the first post still functions even after saving to the Desktop.
#8
This is something very useful to have bookmarked in your browser.

RGB Color Codes Chart
http://www.rapidtables.com/web/color/RGB_Color.htm
#9
Thank you erico for your list of tools and comments.
tinkercad and 3dtin seem to be most interesting to me as they are easy to use and also let you start making geometric shapes right away.
sketchup is commercial and is very expensive at $695.
sketchfab does indeed make organic shapes. one starts with a blob or sphere and then makes changes to it.
corcotile3d looks interesting and the registration fee is only $10.
subdivformer is a tool for android devices.
Thus, I will look more into tinkercad and 3dtin.
Your suggestion that I build vector arrows directly inside glbasic is what I trying right now. The advantage is that no .ddd files would be required, everything being contained in the code.
There are so many tools available it is hard to decide which to use!
#10
QuoteWhat can Inline C++ be used for?
It turns out that GLBasic does not have a function that will convert a Hexadecimal string to a Decimal number.
One has to create a function containing INLINE code to call the sscanf function that will do the conversion.
#11
FAQ / Re: Windows 8
2016-Aug-13
I hope people were able to upgrade their Windows 8 and 8.1 operating systems to Windows 10 before the deadline expired.
Windows 10 is a big improvement over 8 and 8.1.
#12
QuoteJust put that inline to second file and add it to your project, like in my previous post. ;]
Yes, that is the solution. Thank you again dreamerman.
I named the second file "INLINE2.gbas" and added it to the project.
It works, and then I tried removing the closing and opening of the __GLBASIC__ namespace as is shown in this code:

Code (glbasic) Select
// --------------------------------- //
// Project: Inline
// File:    Inline2.gbas
// Start: Friday, August 12, 2016
// IDE Version: 14.001


// SETCURRENTDIR("Media") // go to media files
?IF 1
INLINE
//        }
                extern "C" {
                        #include <cstdio>
                }
//        namespace __GLBASIC__ {
ENDINLINE
?ENDIF

FUNCTION scan_key%:
        INLINE
                sscanf(A_Str,"%x",&value);
        ENDINLINE
ENDFUNCTION


And the code still worked!

What are the rules for when one should close and then re-open a namespace in INLINE code?

#13
I was looking at the generated code for my INLINE test program that does not compile.
It seems that the first '}' in the INLINE code will match up with the starting '{' of the main program code block,
Quoteint __MainGameSub_(void)
{
After the first '}' in the INLINE code there is no more main program code to continue with!
So it looks like one cannot close the __GLBASIC__ namespace in the main program.
What can one do?
#14
There seems to be a problem when closing and then opening the __GLBASIC__ namespace in the main program.
This code will not compile.
Code (glbasic) Select
// --------------------------------- //
// Project: INLINE
// Start: Friday, August 12, 2016
// IDE Version: 14.001

STDOUT "***INLINE Test***\n"

INLINE
}
namespace __GLBASIC__ {
ENDINLINE

END


The errors reported are:
Quoteerror: expected constructor, destructor, OR TYPE conversion before ';' token
error: expected unqualified-id before "return"

Code is being compiled on a Windows 7 SP3 64-bit computer.
#15
Thank you dreamerman.
I am still having problems making a GLBasic console program that will convert a Hex string into a Decimal value.
Here is my code:
Code (glbasic) Select
// --------------------------------- //
// Project: INLINE Test
// Start: Friday, August 12, 2016
// IDE Version: 14.001
//
// Note:
// Check "Project->Options->Console" to make console exe

GLOBAL value%
GLOBAL A$
STDOUT "***INLINE Test***\n"
value=0

STDOUT "Enter Hex Number > "
A$=STDIN$()

INLINE
}  // Close __GLBASIC__ namespace

extern "C" {
#include <cstdio>
sscanf(A_Str,"%x",&value);                     
}
             
namespace __GLBASIC__ {
ENDINLINE

STDOUT "Decimal Value = "+value

// wait for user input to exit
A$=STDIN$()


I am getting these kinds of errors when compiling:

Quoteerror: expected constructor, destructor, or type conversion before '(' token
error: expected constructor, destructor, or type conversion before '=' token
error: expected unqualified-id before "return"