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.


Messages - matty47

Pages: 1 2 [3] 4 5
31
Bug Reports / Compiling for OSX
« on: 2008-May-23 »
I tried compiling a program using entity lib for osx ppc and got the following error
Code: (glbasic) [Select]
*** Configuration: OS-X_UNI ***
precompiling:
GPC - GLBasic Precompiler V.2008.093 - 3D, NET
Wordcount:332 commands

compile+link:
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glAttachObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCompileShaderARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateProgramObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateShaderObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glDeleteObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetBufferParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetInfoLogARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetObjectParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetUniformLocationARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glLinkProgramARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glShaderSourceARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1fARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1iARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUseProgramObjectARB in section (__DATA,__data)
collect2: ld returned 1 exit status
*** FATAL ERROR - Please post this output in the forum
Any idea??
THanks
Matthew

32
Thanks mighty quick answer. Sort of fixed it I need to play with it some more.
Matthew

33
3D-snippets / Entity System - Light rotation
« on: 2008-May-20 »
Hi, I have been playing with the Entity System code but am having trouble with the light direction. The lights are drawn in the following code
Code: (glbasic) [Select]
X_SPOT_LT iLight, o.color, o.Mg[12], o.Mg[13], o.Mg[14], _
o.Mg[12]+o.Mg[0], o.Mg[13]+o.Mg[1], o.Mg[14]+o.Mg[2], o.cutoff
and I know that the first three entries on the second line are supposed to give the vector of the light direction. Note that I have added a new field to the entity type (cutoff) with a couple of functions tha allow me to change the cutoff angle of the spotlight. My problem is that if I set the cutoff to say 45 to make a regular spotlight and then do an entity rotate in the main loop the light doesn't seem to rotate. I suspect this line as the camera uses the same code but with the camera you are specifying the point to which the camera is pointed whereas with the light I believe you are specifying a vector from the light (not a point). Before I go off writing separate light routines can anyone tell me the correct entries for the vector - or have I missed something again.
Thanks for any help
Matthew

34
Code Snippets / Colour extraction
« on: 2008-Feb-28 »
A few functions to extract the component values of a 32 colour and an example of how to use them. I have adapted the example code from a DarkbasicPro tutorial so if you feel this infringes any copyright please remove. Hopefully the code is commented enough to work out. You will need a 200 x 200 pixel image with a spectrum of colours for the sprite.
Code: (glbasic) [Select]
// --------------------------------- //
// Project: RGB_Tute2
// Start: Thursday, February 28, 2008
// IDE Version: 5.179
//load our image
LOADSPRITE "rgb.png",1
//drawing to 2d screen
X_MAKE2D
//draw our base picture
DRAWSPRITE 1,0,0
LOCAL x=190
LOCAL y=190
LOCAL col,tx,ty,r,g,b,timer,TimeTaken
GLOBAL blue,green,red,alph
timer=GETTIMERALL()
FOR ty=0 TO y
FOR tx=0 TO x
col=GETPIXEL(tx,ty) //get the colour at tx,ty
//now split the colour into its components
r=rgbr(col)
g=rgbg(col)
b=rgbb(col)

//now use these to draw 3 images
SETPIXEL tx+200,ty,RGB(r,0,0)
SETPIXEL tx+400,ty,RGB(0,g,0)
SETPIXEL tx+600,ty,RGB(0,0,b)

//now draw another 3
SETPIXEL tx+200,ty+200,RGB(r,g,0)
SETPIXEL tx+400,ty+200,RGB(r,0,b)
SETPIXEL tx+600,ty+200,RGB(0,g,b)

//and finally another three
SETPIXEL tx+200,ty+400,RGB(r*2,g*2,b*2)
SETPIXEL tx+400,ty+400,RGB(r-tx,tx,b-tx)
SETPIXEL tx+600,ty+400,RGB(150,g/2,b/2)


NEXT
NEXT
TimeTaken=GETTIMERALL()-timer
PRINT "Time Taken = "+TimeTaken,10,550
SHOWSCREEN
KEYWAIT
END


//*************************************
//Function rgbr(col) - return the red component of a 32 bit colour
//*************************************
FUNCTION rgbr: col
red=bAND(col,0xff)
RETURN red
ENDFUNCTION
//*************************************
//Function rgbg(col) - return the green component of a  32 bit colour
//*************************************
FUNCTION rgbg: col
green=bAND(col/0x100,0xff)
RETURN green
ENDFUNCTION
//*************************************
//Function rgbb(col) - return the blue component of a  32 bit colour
//*************************************
FUNCTION rgbb: col
blue=bAND(col/0x10000,0xff)
RETURN blue
ENDFUNCTION
//*************************************
//Function rgba(col) - return the alpha component of a  32 bit colour
//*************************************
FUNCTION rgba: col
alph=bAND(col/0x1000000,0xff)
RETURN alph
ENDFUNCTION
The image I used had that transparent colour (pink) in it so the effect was a bit marred. (Is there a way to turn off the pink transparency??) You need to set the resolutuin to at least 800x600
I tested the speed in both DarkBasic Pro and GLBasic. - DBP 11.44secs, GLB - 1.84secs.
Hope this may be useful
M

35
GLBasic - en / Scene lighting
« on: 2008-Feb-21 »
Thanks I will try this. As I said I probably missed something.
Thanks for your patience

36
GLBasic - en / Scene lighting
« on: 2008-Feb-21 »
Bump??

37
GLBasic - en / GL Basic physics
« on: 2008-Feb-17 »
GLBasic supports the Newton phycis library and there is an include file and a few examples in the package.

38
GLBasic - en / Scene lighting
« on: 2008-Feb-17 »
I just tried that. It has made a difference. There is now a difference in turning the light on and off. I have tried varying the cutoff and the distance from the plane and the lighting does not seem tovary smoothly but rather "jumps" between finite states. Eg leave the light at its start point and vary the cutoff. You will see what I mean. Similarly leave the cutoff at the start value and move the light toward the plane. For me the light switshes state when it is closer to the plane than the camera. I was expecting (hopong) that the cutoff would show a shrinking ring of illumination . Sorry to be a pain.

39
GLBasic - en / Scene lighting
« on: 2008-Feb-17 »
I am not working with shadows at the moment. I just don't know if the lights are working in 3D. I have made two small examples. The first just draws a plane and puts the camera 10 units away from it. No lighting commands. The plane shows in the 3d view when the program is run.
Code: (glbasic) [Select]
// --------------------------------- //
// Project: lights2
// Start: Sunday, February 17, 2008
// IDE Version: 5.173

//create a plane to catch the light
MakePlane(1)

//Main loop
WHILE TRUE

X_MAKE3D 0.1,500,90
X_CAMERA 0,0,15,0,0,0
X_DRAWOBJ 1,0

SHOWSCREEN
WEND




FUNCTION MakePlane:pn
X_OBJSTART pn
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJADDVERTEX -10,10,0,0,0,RGB(128,128,128)
X_OBJADDVERTEX 10,10,0,1,0,RGB(128,128,128)
X_OBJADDVERTEX 10,-10,0,1,1,RGB(128,128,128)
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJEND
ENDFUNCTION
Now I add a spot light to the scene and you can turn it on and off, change the cutoff angle and move it forwards and back along the z axis. I can't see any difference here to the first program. So what is the light doing??
Code: (glbasic) [Select]
// --------------------------------- //
// Project: Lights
// Start: Sunday, February 17, 2008
// IDE Version: 5.173
//create a plane to catch the light
MakePlane(1)
//create a varaible to alter the cutoff
LOCAL cutoff=90
//and one to hold the z value of the light
LOCAL lightz=20
//a toggle for the light
LOCAL On=1
LIMITFPS 12
//Main loop
WHILE TRUE

X_MAKE3D 0.1,500,90
X_CAMERA 0,0,15,0,0,0
X_DRAWOBJ 1,0
IF On =1 THEN X_SPOT_LT 0,RGB(255,255,255),0,0,lightz,0,0,-1,cutoff

IF KEY(45)=1 THEN On=ABS(On-1)
IF KEY(37)=1
cutoff=cutoff-1
IF cutoff<5 THEN cutoff=5
ENDIF
IF KEY(38)=1
cutoff=cutoff+1
IF cutoff>180 THEN cutoff=180
ENDIF
IF KEY(30)=1 THEN lightz=lightz-1
IF KEY(44)=1 THEN lightz=lightz+1

X_MAKE2D
PRINT "Use K and L to change the cutoff angle",0,10
PRINT "Use A and Z to move the light on the Z axis",0,20
PRINT "Use X to toggle the light on and off",0,30
PRINT "The light is pointing into the screen always",0,40
PRINT "On Value: "+On,0,80
PRINT "Cutoff Angle: "+cutoff,0,100
PRINT "Light at 0,0,"+lightz,0,120



SHOWSCREEN
WEND




FUNCTION MakePlane:pn
X_OBJSTART pn
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJADDVERTEX -10,10,0,0,0,RGB(128,128,128)
X_OBJADDVERTEX 10,10,0,1,0,RGB(128,128,128)
X_OBJADDVERTEX 10,-10,0,1,1,RGB(128,128,128)
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJEND
ENDFUNCTION
So my question really is - have I just missed out doing something or are the lights not working. Any help would be greatly appreciated
Matthew

40
GLBasic - en / Scene lighting
« on: 2008-Feb-17 »
Anyone tried the example? I just don't seem to be able to understand how to set up the lights. I assumed that if there were no lights then you should be unable to see anything. Is this a wrong assumption?

Anyone?
Thanks
Matthew

41
GLBasic - en / Scene lighting
« on: 2008-Feb-14 »
In the light example I can see no difference in the "off", "ambient" ,"multitexture" and "spot" modes. The "bump" and "cartoon" modes do appear to have shadows but I can't say that there is any variation in the light (no attenuation). The shadows example likewise show a shadow but again the rest of the lighting is pretty uniformly lit. Am I expecting too much??
Thanks
MAtthew

42
GLBasic - en / Scene lighting
« on: 2008-Feb-14 »
No takers???
Matthew

43
GLBasic - en / Scene lighting
« on: 2008-Feb-12 »
Hi,
please look at the project in the zip
http://members.optusnet.com.au/~ingle.m/3droom.zip
When I run this I can see the model OK even though I have not made any lights. If I add a light nothing changes. I think I am missing something fundamental here. (Note I have added extra stuff to the T3DEntity file)
Any help appreciated
Matthew

44
Code Snippets / Plane Lib
« on: 2008-Jan-12 »
The only bmp I used was a tileable water texture. Any would do. Just adjust the name in the code. I think the original was 256 x 256 pixels but you could use larger. Possible could add a bump texture to make the water look more realistic?
Thanks
Matthew

45
GLBasic - en / Linking error (demo)
« on: 2008-Jan-02 »
Hi,
I ran into troubles having MingW installed on my system. GLBasic picks up the wrong compiler/libs and fails to compile properly. I overcame this by removing the environmental variable (c:\MingW\bin in the PATH variable) and renaming the MingW directory (in case there are some entries in the registry) GLBasic then behaved normally. When I want to use MingW I do the reverse.(rename the directory and add the MingW dir to the PATH variable). Bit kludgy but it works
Matthew

Pages: 1 2 [3] 4 5