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 - CCJ

Pages: [1] 2
Hi all,

I am having some trouble creating what should be a simple animation for an iPhone app I'm working on--

Code: (glbasic) [Select]
LOADANIM "yesnobuttons.png", 0, 295,300
FOR y=0 TO 19
  DRAWANIM 0, y, 0, 100


The animation is supposed to draw two buttons rising up out of the ground for the user to press, but instead I just get crazy mangled looking results.  Is there an easy way to just load in and display a pre-made animation, and have it run through its frames in one location (i.e. not require any user input to etc. to change frames as in a walking animation).  Also, what's the best way to control the speed at which an animation iterates through its frames?  As you can see here I just made it pause at every frame so I could check on what was being displayed, but in the final app the animation should run smoothly on its own when called.

IIRC Newton offers a static lib for iPhone.
But it is Newton 2.0, so one would have to adjust my wrapper.

How much adjustment do you expect it would need?  If it would basically need a complete overhaul, are there any alternative physics plugins/static libraries compatible with GLBasic for 2D/3D games?  Does Box2D have support for 3D, and does the download link in the first post of the Box2D thread contain the most updated version?  In reading through it I saw there were a number of additions/changes (such as the Include files posted a bit down the first page) and I was wondering if they still need to be applied to the original post download link...



hey all,

Despite Apple's recent 'relaxation' of restriction policies I thought I'd ask about this before planning a project around Newton Physics-- Are .dll calls (like those used in Newton SDK projects) allowed in iPhone apps now?  In the Apple press release I believe they said the only thing apps still cannot do is 'download code,' so I expect that calls to dll files would be allowed... but you never know with Apple.  Anybody know their policy here?



nah, no Box2D.

Just do this: connect each of the nodes with a "rubber band". Store the original rubber band length.

Now, after you moved one point, 4 rubbers are stressed. Iterate through all rubbers. If they are pressed, push the attached nodes by 0.1 * what the rubber is too short now (leave out the node you just move!!). If they are pulled move in the other direction.
Draw the grid. Repeat that.

That sounds like a plan, but I'd still like to know the right files to integrate for box2d; creating my own physics "the hard way" as detailed above could become cumbersome after awhile...   



take a look at Samples/Media/Polyvector. It's basically that without the interactive movement of the points.

Ah, this is very interesting indeed... question is, how would I apply 'springiness' to the points so that after I drag them and let go they snap back to their original position and bounce until some specified damping value makes them still again?  Would Box2D be a good place to look for such effects?  Speaking of which, where can I download the most up to date Box2D files-- I searched the download showroom and the Box2D thread here on the forum and came up with several different downloads, all seemingly rather dated.

I'd create this effect (and perhaps other similar types such as water surface) in real-time constructed 3D model with Box2D handling the physics.

I don't suppose GLBasic has a tracing function or something to quickly create said 3d meshes out of bitmap sprites, does it?  Manually making a flat mesh from a sprite in a 3d modeling program like Blender can be a pain... that's also why I wanted to know if this deformation effect could be achieved without ever changing the image format from bitmap-- Flash has the DisplacementMapFilter [] class for this purpose; does GLBasic have any equivalent functions that could read in the pixel values of a bitmap image and manipulate it with them?

Thanks all,


Hmm, very interesting link; I think something like that could certainly work.  I'd really love to get some help on how to implement the described algorithm in GLBasic however-- making the polygons and such shouldn't be too difficult to figure out, but what about texturing them with the regions they are meant to deform?  Also, how do I achieve the spring/damping movement effect with GLBasic?

Hello all,

I am very interested in applying the warp/deform effect seen in the iPhone app Wobble (it lets you define regions on a raster image and then deforms those regions as it gets input from the accelerometer or the user's touch as if they had adopted faux soft-body physics) to a game I am making, but I'm not sure how this effect was achieved.  Anyone have any advice as to how I might program an analogous effect using GLBasic?



Aha, yes well that would cause a problem.  Even in the most recent build [that I can find by going into Showroom -> DDgui] you have to find/replace all instances of the apparently outdated FILLRECT command with DRAWRECT for it to work... Otherwise the compiler simply reports "syntax error," which isn't a whole lot of help.  Anyway, thanks for the help!

Hi all,

When compiling the DDgui project files from the "DDgui_proportional" download [unmodified] I get the following compilation error output:

Code: (glbasic) [Select]
*** Configuration: WIN32 ***
GPC - GLBasic Precompiler V.6.922 SN:db0cc0c3 - 3D, NET
"DDgui_test.gbas"(72) warning : implicitly created GLOBAL  : num$
"DDgui_test.gbas"(73) warning : implicitly created GLOBAL  : col$
"DDgui_test.gbas"(74) warning : implicitly created GLOBAL  : text$
"DDgui_test.gbas"(83) warning : implicitly created GLOBAL  : now
"DDgui_test.gbas"(84) warning : implicitly created GLOBAL  : flips
"DDgui_test.gbas"(85) warning : implicitly created GLOBAL  : nt
"DDgui_test.gbas"(87) warning : implicitly created GLOBAL  : old
"DDgui_test.gbas"(87) warning : implicitly created GLOBAL  : fps
"DDgui_test.gbas"(180) warning : implicitly created GLOBAL  : index
Wordcount:3009 commands
C:\DOCUME~1\jeffreyc\LOCALS~1\Temp\glbasic\gpc_temp2.cpp: In function `DGInt __GLBASIC__::ReadKern(__GLBASIC__::DGStr, __GLBASIC__::DGIntArray&, __GLBASIC__::DGIntArray&, DGInt)':
C:\DOCUME~1\jeffreyc\LOCALS~1\Temp\glbasic\gpc_temp2.cpp:1855: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:938: error: in passing argument 2 of `void __GLBASIC__::READBYTE(DGNat, DGNat&)'
C:\DOCUME~1\jeffreyc\LOCALS~1\Temp\glbasic\gpc_temp2.cpp:1863: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:938: error: in passing argument 2 of `void __GLBASIC__::READBYTE(DGNat, DGNat&)'
*** FATAL ERROR - Please post this output in the forum
*** Finished ***
Elapsed: 123.4 sec. Time: 12:48
Build: 0 succeeded.
*** 1 FAILED ***

The DDgui project is documented as having been created in 2008 with version 5 of GLBasic-- did something big change since then that would have caused this example program to fail?



@Ian Thanks for the advice/examples!  You make a good point, and I've used this approach before, but I'm interested in learning to use the GLBasic commands that are meant specifically for GUI construction with widgets.  It would be very nice if someone could create a 'visual forms builder' style WYSIWYG GUI construction tool for GLBasic...

@codegit That wouldn't surprise me in the least... anyway games are my main interest so it's sort of a non-issue.

Hello all,
Where can I find some good documentation/tutorials/etc. on the subject of GUI programming in GLBasic, with an emphasis on iphone GUI construction?  I downloaded the DDGui example program, but all it has is a long comment at the outset with terse explanations of commands.  Technically it won't even compile right away (it was posted several years ago and a certain command, I believe it was 'fillrect' must have changed because the compiler doesn't recognize it), so additional/updated resources would be nice.  Are there any? I know there are also a few alternatives to the DDGUI commandset floating around-- where can I find documentation on them?  Do they work at all with the iphone?  Finally, has the performance of DDGUI improved at all on the iphone recently?  Last I heard it didn't work all that well [specifically scrollbars as I recall simply failed to function, and other elements ran slowly].

Ah yes I see it now... the section on types was what I really needed to clear this up.  Thanks!

So then mouse[].active was a UDT programmed in C by the author of the example program???  I searched in the files associated with this program and couldn't find any extra .c/.h/.cpp external files that might have defined mouse[].active so I assumed it was a native GLBasic function... Also, doesn't GLBasic have support for the creation of UDTs with GLBasic alone?  It would be an awful hassle to have to program UDTs in C and then include them from within the GLBasic program.

The iphone touch example is extremely handy, but I have a question about some of the code, most particularly the mouse[].active function-- where is this function in the GLBasic documentation?  I searched but couldn't turn up any results in the help files.  This function is obviously pivotal for touch commands in GLBasic, so I would like to know more about it.  Also, I couldn't turn up any analogous examples of dot notation like that which is used in mouse[].active anywhere in the documentation so if anybody could explain the mechanics of this syntax in GLBasic and where I can find more about it I would be most appreciative.

Thank you,


Pages: [1] 2