[Released] iXors3D Header Update and Library Update (ver 0.111)

Previous topic - Next topic

codegit

Hi Ian

Have you tried anything with Physics? I get compile error when using iXors3d with C and the physic functions. I have not yet had a chance to try this with your header as my logic says that if I cannot getting it working with xCode and c then this will also have problems.  :(
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

mentalthink

HI Ian, excuseme for not write before.
Now I probe your application on my Iphone and works very well, it´s amazing and it´s a great value for Glbasic, can be done things in 3D for me is very insteresant.

I have a couple of questions, one I think is a silliness, but i´m not sure:

1º If I can test the 3d in GLbasic, but whit standard compiling, in this case Windows, it´s can be do, because I goes crazy for made this, or the mode of use of this library, is make the code in windows and text on iphone every time what I update the code for make the tests.

2ª Excuse me about this question but, whit the .gbal of ixors, I need to buy the ixors from the web, because I don´t watch any whatermark on your example, I think waht have to buy, but if not appears, whatermarks or is fully functional, I supposed if for themes of legalety of the library.

Since Ian, thanks for this AMAZING complement for GLbasic, I think go to be amused and fun a lot of time, whit this super-usefull library.

Best Regards Iván J.

Anything you need , make me know.


bigsofty

Hi James,

Well, it compiles in GLBasic, well the header checks out with the lib at least. Are you sure you are using the latest lib (.a)?

I will check out the physics as soon as time allows.

Hi Ivan,

Well syntactically iXors3D and Xors3D are almost identical, so I would imagine that you could write your game using Xors and then recompile, with a few alterations, for iXors. You would of course need a set of GLBasic headers for Xors too. Oh, and also restrict yourself to the commands that are available in both libraries... Xors has a few extra commands when compared to iXors.

The lib off of my blog does not seem to have a watermark but it IS time limited, so after a while it just stops.

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

bigsofty

James,

I converted the Obj-C iPhone physics demo to GLBasic. It seems to be working fine.

I'll post the code tomorrow, after its been tidied up, here. Too tired tonight.

Cheers,


Ian 
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

bigsofty

OK, here is the 'Smash The Wall' physics demo.

Things to note...

The frustum clipping is broken, its a bug, its stuck on portrait, so in landscape, things get clipped a bit short horizontally. This has already been fixed but not upload to the users yet.

The 'DIM z%[1]' is necessary to allow the GLB graphics engine to kick-in/initialise, as its the first command. So its function is not to create a variable but to 'wake' up GLBasic for iXors3D to take over later.

I had trouble with iOS 4.0, this may be a problem with GLB or iXors. Any ways, I set "Base SDK" and "iPhone OS Deployment Target" to 3.2 in the project settings and everything works fine.

Have fun,


Ian


Code (glbasic) Select
GLOBAL light%
// camera entity
GLOBAL mainCamera% = 0;
// ground entity
GLOBAL ground%     = 0;
// control images
GLOBAL control%    = 0;
GLOBAL fire%       = 0;

GLOBAL wallTexture%
GLOBAL grass%

DIM z%[1]

init()

WHILE 1=1
drawView()
xUpdateWorld(1)
xRenderWorld()
xDrawImage(control%, 190, 190, 0)
xDrawImage(fire%, 5, 270, 0)
xText(0,0,"FPS:"+xFPSCounter(),FALSE,FALSE)
xFlip()
WEND

// initialize engine
FUNCTION init:
xGraphics3D(1)
light%=xCreateLight(0,0)
// create camera
mainCamera% = xCreateCamera(0);
xPositionEntity(mainCamera%, 0.0, 50.0, 50.0, FALSE)
xRotateEntity(mainCamera%, -45.0, 0.0, 0.0, FALSE)
// create ground
ground% = xCreateCube(0);
xScaleEntity(ground%, 100.0, 0.1, 100.0, FALSE)
xEntityAddBoxShape(ground%, 0.0, 0.0, 0.0, 0.0);
grass% = xLoadTexture("Media/grass.png", 1 + 8)
xEntityTexture(ground%, grass%, 0, 0)
xFreeTexture(grass%)
// create wall
wallTexture% = xLoadTexture("Media/logo.png", 1 + 8)
GLOBAL wallSize% = 6
GLOBAL cube%
FOR y% = 0 TO wallSize% - 1
FOR x% = 0 TO wallSize% - 1
cube% = xCreateCube(0)
xPositionEntity(cube%, (x - wallSize% / 2) * 2.0, 1.1 + y * 2.0, 0.0, FALSE)
xEntityTexture(cube%, wallTexture%, 0, 0)
xEntityAddBoxShape(cube%, 1.0, 0.0, 0.0, 0.0)
NEXT
NEXT
// load default font
xSetFont(xLoadFont("Media/Tahoma22"))
// load control images
control% = xLoadImage("Media/control.png");
fire%    = xLoadImage("Media/fire.png");
ENDFUNCTION


// checks if button prssed
FUNCTION InButton: x%, y%, cx%, cy%, radii%
x = x - cx
y = y - cy
RETURN (ABS(SQR(x * x + y * y)) <= radii)
ENDFUNCTION

// shoot sphere to wall
FUNCTION ShootSphere:
LOCAL sphere% = xCreateSphere(8, 0)
xPositionEntity(sphere%, xEntityX(mainCamera%, TRUE), xEntityY(mainCamera%, TRUE), xEntityZ(mainCamera%, TRUE), FALSE)
xTFormNormal(0.0, 0.0, -1.0, mainCamera%, 0)
xEntityAddSphereShape(sphere, 1.0, 0.0)
xEntityApplyCentralImpulse(sphere%, xTFormedX() * 100.0, xTFormedY() * 100.0, xTFormedZ() * 100.0)
xEntityColor(sphere%, 120, 0, 0)
ENDFUNCTION


FUNCTION drawView:

// Background
xClsColor( ABS(SIN(GETTIMERALL()/100))*255, ABS(SIN(GETTIMERALL()/300))*255, ABS(SIN(GETTIMERALL()/600))*255 )
xCls()

// camera controll
LOCAL radii% = 24;
LOCAL fcx%   = 70 + 190
LOCAL fcy%   = 28 + 190
LOCAL bcx%   = 70 + 190
LOCAL bcy%   = 98 + 190
LOCAL lcx%   = 35 + 190
LOCAL lcy%   = 62 + 190
LOCAL rcx%   = 104 + 190
LOCAL rcy%   = 62 + 190
LOCAL tlcx%  = 182 + 190
LOCAL tlcy%  = 62 + 190
LOCAL trcx%  = 252 + 190
LOCAL trcy%  = 62 + 190
LOCAL tucx%  = 218 + 190
LOCAL tucy%  = 28 + 190
LOCAL tdcx%  = 218 + 190
LOCAL tdcy%  = 98 + 190

FOR i = 0 TO xCountTouches()
IF (xTouchPhase(i) > 0)
// forward
IF (InButton(xTouchX(i), xTouchY(i), fcx,  fcy,  radii)) THEN xMoveEntity(mainCamera%,  0.0,  0.0, -1.0, FALSE)
// backward
IF (InButton(xTouchX(i), xTouchY(i), bcx,  bcy,  radii)) THEN xMoveEntity(mainCamera%,  0.0,  0.0,  1.0, FALSE)
// left
IF (InButton(xTouchX(i), xTouchY(i), lcx,  lcy,  radii)) THEN xMoveEntity(mainCamera%, -1.0,  0.0,  0.0, FALSE)
// right
IF (InButton(xTouchX(i), xTouchY(i), rcx,  rcy,  radii)) THEN xMoveEntity(mainCamera%,  1.0,  0.0,  0.0, FALSE)
// turn left
IF (InButton(xTouchX(i), xTouchY(i), tlcx, tlcy, radii)) THEN xTurnEntity(mainCamera%,  0.0, -1.0,  0.0, TRUE)
// turn right
IF (InButton(xTouchX(i), xTouchY(i), trcx, trcy, radii)) THEN xTurnEntity(mainCamera%,  0.0,  1.0,  0.0, TRUE)
// turn up
IF (InButton(xTouchX(i), xTouchY(i), tucx, tucy, radii)) THEN xTurnEntity(mainCamera%,  1.0,  0.0,  0.0, TRUE)
// turn down
IF (InButton(xTouchX(i), xTouchY(i), tdcx, tdcy, radii)) THEN xTurnEntity(mainCamera%, -1.0,  0.0,  0.0, TRUE)
// fire button
IF ((InButton(xTouchX(i), xTouchY(i), 29, 294, 24)) AND (xTouchPhase(i) = TOUCH_BEGAN%)) THEN ShootSphere()
ENDIF
NEXT

ENDFUNCTION




[attachment deleted by admin]
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Ian Price

QuoteI think we can safely ignore this last message as spam...
I've removed several from the same member already today. I'll remove this one too :)
I came. I saw. I played.

bigsofty

Updated to 0.111, see 1st post please.

The physics demo above is pretty slow, the physics lib is still being worked on and I have been informed that it should not be used till its more optimised for the iPhone platform.

Still, Box2D was added in this update!  ;)

I'll try and rustle up a Box2D demo when time permits.

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

codegit

Ian, cool. Thanks for the speedy updates, much appreciated.  8)
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

bigsofty

NP James, I am glad you can make use of it.  ;)

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

bigsofty

Sorry, no updates for the last month, been dealing with a health problem, will update it for sure of the next couple of days.

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

aonyn

Hi Ian (or anyone who knows the answer)

I have written an app using my partially complete xors3d header.
Now I want to try and convert it to you ixors3d header and compile for iphone, but I am not entirely clear how to setup ixors3d for glbasic.

I did see an earlier post in this thread, referring to a txt file which explains the setup, but alas, I cannot find the file. It appears the 7z file with your header only has the gbas file, there are no other files extracting.

Where may I find these instructions, or a brief rundown in a post here I would greatly appreciate.

Thanks in advance,
Dave
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

bigsofty

Hi,

Sorry for the slow reply, can you tell me if you have the full iXors version or the trial? I will build a new header and bundle the installation instructions with you required version.

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

aonyn

Hi Ian,

Thank you very much for your help.  :booze:
I purchased the indie bundle, so I have full license for xors3d and ixors3d.

regards,
Dave
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

bigsofty

No problem Dave, I'll get the latest headers and convert them tonight or tomorrow at the latest.

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Betlheem

Just curious. The link is dead, there is any other way to get the ixors3d for glbasic? And... is iphone exclusive or could be android cpmpatible too??