Qbasicnews.com
December 06, 2019, 02:09:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 ... 8 9 [10] 11
  Print  
Author Topic: FreeBasic forum and examples/previews quicklist  (Read 61106 times)
zydon
Member
*
Posts: 69



« Reply #135 on: December 22, 2004, 11:07:43 AM »

Wow! now GOTO is become an issue. Whats about it that was so 'evil' for programmers? I used to see some matured/old-timer basic coders use them widely and normally I can't follow their coding style at first. But when I use them, I feel a bit fredom in coding it.
Logged

 = inc() Cheesy
Sterling Christensen
Na_th_an
*****
Posts: 1328


« Reply #136 on: December 22, 2004, 05:16:23 PM »

I'll agree goto was very harmful when it was used with line numbers, but I think it's fine and readable enough if you use it to do things that are simple and reasonable but impossible without goto (like exiting multiple DO/LOOPs at once without using an exit flag), or if you only goto informatively named labels... as long as you don't use goto too much and never use it in place of something like an IF block or a DO/LOOP - that's just wrong, use high level language constructs instead of goto whenever possible.
Logged
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #137 on: December 23, 2004, 01:45:39 PM »

Goto is impossible to avoid.  You GOTO, it gets turned into jmp.  If you call a SUB, it uses jmp and a return register.  Same for GOSUB.  This entire argument is desultary.  Use clean code if you're in a group, don't give a rat's petunia about clean code and use goto where it's convenient.
Logged
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #138 on: January 14, 2005, 04:31:34 AM »

Here's a new 3D demo!!!  Cheesy

It has a few bugs, but it's still pretty cool to me. Tongue

http://www.qbnz.com/dr_davenstein/glu_LookAt.zip
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #139 on: January 14, 2005, 04:58:17 AM »

Shocked  Shocked  Shocked  Shocked  Shocked  Shocked

That's awesome!!!!!

I can see you're using the camera ftansform used by Ben Humphrey and Alan Bayliss. :*)

I'm using them as well. :*)

For a 3rd person perspective ala metal gear solid, try to swap the Camera lookat and the camera itself.

That collision is what most 3d coders use(spherical) but you can optimize it a lil bit by not using SQR and testing it by 25 instead of 5.

Try to do a display list. It would make it real fast. :*)

Now that the GLu header is finished, try to add some quadrics for NPCS. Smiley

Can the OBJ file have normals in them?
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
steven_basic
Senior Member
**
Posts: 244


WWW
« Reply #140 on: January 14, 2005, 11:54:12 AM »

Quote from: "Dr_Davenstein"

Here's a new 3D demo!!!  :D


Can't recompile on this end...

walkaround.bas(318) : error 10: Expected '=', found: 'Cam.X'

Any idea what I'm missing?
Logged

ature has its way of warning a person away from danger:  The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #141 on: January 14, 2005, 12:35:47 PM »

GluLookAt is not declared at glu.bi on version 0.10, rel sent me the full header translated 2 days ago, it will be included on the next release.

Cool demo ;), but it ran really slow on my nvidia mx440 crappy card, so i recompiled it using a 16-bit video mode (instead of the 24-bit one), and it ran 5x faster.. looks like nvidia cards hate 24-bit modes -- 32-bit is okay too.
Logged

steven_basic
Senior Member
**
Posts: 244


WWW
« Reply #142 on: January 14, 2005, 01:56:47 PM »

Quote from: "v3cz0r"
but it ran really slow on my nvidia mx440 crappy card, so i recompiled it using a 16-bit video mode (instead of the 24-bit one), and it ran 5x faster.. looks like nvidia cards hate 24-bit modes -- 32-bit is okay too.


This I don't think is a nvidia problem.  Most Game programming sites I've been on all seem to agree that much like the processor handling 32bit integers faster than other sizes, video cards handle certain byte sizes (16/32bit) better than others (24bit).

*  Actually, I think "kiss-of-death" was the term used for programs running in 24bit video resolution. *
Logged

ature has its way of warning a person away from danger:  The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #143 on: January 14, 2005, 10:20:41 PM »

Quote from: "relsoft"

I can see you're using the camera ftansform used by Ben Humphrey and Alan Bayliss. :*)

I'm using them as well. :*)

For a 3rd person perspective ala metal gear solid, try to swap the Camera lookat and the camera itself.

That collision is what most 3d coders use(spherical) but you can optimize it a lil bit by not using SQR and testing it by 25 instead of 5.


Yeah, that camera style's really smooth.  I hate distance formula collision detection though. I want to use sphere@plane collision, instead of sphere@sphere, but I'm having problems with the normals.

Quote from: "relsoft"

Try to do a display list. It would make it real fast. :*)


I'm going to make a litttle platform game, and I'm going to try to use gl vertex arrays to store all the model data. I read somewhere that it will automatically recall vertices that were already computed. .. and no looping through all the faces!  Tongue

Quote from: "relsoft"

Now that the GLu header is finished, try to add some quadrics for NPCS. Smiley


Yeah, I will!

Quote from: "relsoft"

Can the OBJ file have normals in them?


No, the obj files don't store normals for some reason. You have to calculate them manually.


Arghhh!!! I didn't realize that I was using 24 bpp still. I just did it for testing purposes and I guess I never changed it back.
 :oops:
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #144 on: January 14, 2005, 10:40:45 PM »

Frustum Culling would speed it up even more. It's not really going to be hard since Digiben's camera system could use it w/o modification.

BTW, what do you mean by GL vertex arrays? Are they the same as display lists?  A URL would be nice. :*)

BTW, I'm working on a complete redo of the GL headers, you don't need to change anything in your code except the vector params.

instead of:

Code:
glvertexfv array(0)

you'd have to pass it's address:

Code:
glvertexfv @array(0)

or

Code:
glvertexfv varptr(array(0))
It's the standard v1c wants since byref some how are a nuisance to FB when running external C code.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #145 on: January 15, 2005, 02:04:10 AM »

If it's going to be an FB standard, then I'm all for it. Tongue  That wont stop the passing of arrays to subs by descriptor, will it? I really miss it.
 :Huh:

Well, I may have read it wrong, but this is from OpenGL RedBook... probably an old version.

Some OpenGL implementations benefit from storing vertex data in vertex arrays. Use of vertex
arrays reduces function call overhead. Some implementations can improve performance by batch
processing or reusing processed vertices.

I was hoping that they meant arrays that will be stored by ogl itself. ...Kinda like when you use glubuild2dmipmaps.
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #146 on: January 15, 2005, 08:11:49 AM »

Well, you are already using vertex arrays.

My tip would be to add frustum culling, then display lists, and use the vector calls of GL funks.  Be sure to store data in sequence though or vector calls would fail.

I've finished 90% of the Gl header.  All I have to do now is "Alias" them. :*)

Edit:
You're right, vertex arrays are implemented in GL 1.1.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Optimus
Member
*
Posts: 37


WWW
« Reply #147 on: February 17, 2005, 07:44:09 AM »

http://www.freewebs.com/optimus6128/

The old examples in another server, instead of Fortunecities..
This server still, doesn't allow external links Tongue

You can find my latest 256b X86 intro and some Tunnel/Floor example (but in C, though I could very easilly port them to Freebasic) there too. I use freewebs for uploading some of my stuff when the other site (optimus.demoscene.gr) is down.

Optimus
Logged

ave a time Smiley
Brad
New Member

Posts: 12


« Reply #148 on: February 17, 2005, 07:58:55 AM »

GOTO  is almost the exact same as the Assembly 'JMP'  command...

there are many situations where JMP is by far the best and fastest way to go... silly not to use it just because the higher-level elite don't understand it!!!  hehehehe
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #149 on: February 17, 2005, 08:17:54 AM »

Once again... OMG, this is the Neverending Story Cheesy :lol:

When I get home this afternoon I'll make a webpage or something with the 2,000 pages discussion about GOTO In this forum :lol:
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Pages: 1 ... 8 9 [10] 11
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!