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.


Topics - matty47

Pages: [1] 2
1
GLBasic - en / Orthographic camera
« on: 2013-Jan-18 »
Hopefully not too dumb a question but I need a drawing surface that has 0,0 at the bottom left corner and increases in x and y across and up respectfully. I think I could use a 3d screen with an orthographic camera to implement this however I can't seem to find a command that would make the camera orthographic and not perspective. Is this possible in GLBasic? and (of course) some guidance on how to do it would be greatly appreciated.
Thanks in advance
Matthew

2
GLBasic - en / x_line, x_dot pickable?
« on: 2012-Jun-03 »
Is there a way to make x_line or x_dot objects pickable with x_collisionray?
I want to be able to draw lines and points on a screen and then pick ( and adjust) individual items.
Thanks for any pointers.

3
GLBasic - en / Arrays in Types?
« on: 2011-Nov-13 »
Are they allowed.
For instance I want to do something like this
Code: (glbasic) [Select]
CONSTANT MaxDims=3

TYPE Point
     Loc[MaxDims]
ENDTYPE

.....................................
//then later do

LOCAL P1 AS POINT
.......................................
FOR i = 0 to MaxDims
      IF P1.Loc[i] ................
Now I know this code won't work but the compiler issues an error for the Loc[MaxDims] line
Any answers greatly appreciated
Thanks
Matthew

4
GLBasic - en / debugger not starting app
« on: 2010-Jan-23 »
Has anyone else had trouble with the degugger? If I enable building with the debugger and then do a compile/run the project compiles, links and then a message appears that the debug session has started but there is no application running. If I turn off the debugger and do a compile/run the application runs fine. I have tried this with various of the samples and always seems to do the same thing. Any ideas??
using the latest version 7.242, Win XP.
THanks
MAtthew

5
GLBasic - en / Size of Mesh
« on: 2009-Jun-15 »
Is there any way to determine the size of a mesh? Looking for something that would give say height, width, depth of a loaded mesh.

6
GLBasic - en / Windows Mobile 6.1
« on: 2008-Oct-15 »
Does GLBasic support the above platform? Looking at purchasing a smartphone with this operating system (320 x 240 display) and wondering if I can use GLB to make programs for it?
Thanks
Matthew

7
GLBasic - en / Newton Physics OS X (PPC)
« on: 2008-Jul-26 »
I believe that GLBasic uses the Newton Library as a dynamic library rather than statically linking. I have the libraries for Windows and Linux, but am not sure how to obtain / make the library for OS X. I am trialling on an Emac with System 10.5 installed. XCode is installed (Although I don't profess to really know how to use it). Has anyone used Newton and GLBasic on OS X? If so could you please give some advice on how to get Newton working or post the newton.dylib somewhere for download.
Thanks for your patience
Matthew

8
GLBasic - en / Newton Error
« on: 2008-Jul-17 »
Hi, I have been fiddling with the Newton examples and am sure that the dddCollision sample worked previously however now when I compile and run this file the ball drops throught the "ground" object. I am sure that I have note changed the code but here it is anyway
Code: (glbasic) [Select]
LOCAL dtime
LOCAL org[] // just a dummy
LOCAL force[]

X_LOADOBJ  "ground.ddd", 0
LOADSPRITE "ground.bmp", 0
X_LOADOBJ  "sphere.ddd", 1
DIM force[3]

// initialize Newton Engine
NewtonCreate()

// default material
NewtonMaterialSetDefaults( 1, .9, .2, .9, .9)

ball = NewtonCreateSphere(.8, .8, .8, org[])
// position ball
NewtonBodySetPosition(ball, 0,12,3)
// enable dynamics
NewtonConvexCollisionCalculateInertialMatrix(ball, 1)
// enable gravity for ball
NewtonBodySetForceAndTorqueCallback(ball)
NewtonBodySetGravity(ball,0,-9.81,0)
NewtonBodySetAutoFreeze(ball, FALSE)


// solid, static ground
ground = NewtonCreateDDD(0, 0)

WHILE TRUE
NewtonUpdate(GETTIMER(), 6)
force[0] = -MOUSEAXIS(0)*3
force[2] = -MOUSEAXIS(1)*3
NewtonBodyAddTorque(ball, force[])
X_MAKE3D 1,100, 45
X_CAMERA 20, 20, -10, 0,0,0

X_AMBIENT_LT 0, RGB(255,255,255)

X_SCALING .8, .8, .8
NewtonDrawBody(ball, 1,0)
X_SCALING 1,1,1
X_SETTEXTURE 0,-1
NewtonDrawBody(ground, 0,0)
SHOWSCREEN
WEND

Using version 5.322
Thanks
Matthew

9
GLBasic - en / Apps on Mac OS x
« on: 2008-May-24 »
Hi, can anyone tell me what are the required frameworks on os x to run glbasic apps? I tried running an executable and found that it required SDL. I installed the SDL.Framework in my home directory and next time apparently libpng was needed. To save trial and error can anyone tell me what I need to install
Thanks greatly for any help you can give.
Matthew

10
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

11
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

12
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

13
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

14
Bug Reports / KeyCode 08
« on: 2007-Dec-09 »
Hi,
just tried to use Key(08) and Key(09) in a program and the following error appeared for the latter

invalid digit "9" in octal constant

Key(10) seems to work OK
Thanks
Matthew

15
GLBasic - en / Semi transparent sprites
« on: 2007-Dec-01 »
I know that color 128,0,255 is treated as transparent when creating images for GLBasic sprites. How do I achieve a "fuzzy" edge for sprites. I created a 128 x 128 png with a pink background. I then drew a white circle on this. I then applied a gaussian blur to geve the edges a blurred effect. When I use this as a sprite there are pink tinges at the edge of the white. (Obviously the blur changes some of the pink background). I also tried doing this with a transparent background. With the transparent background the sprite looked as though it had sharp edges. I must be misunderstanding something. Any help please?
THanks
Matthew

Pages: [1] 2