Free sample code

Feanor
Unregistered
 
Post: #1
I love what you can find on the 'net about 3D graphics. Today I found a great classic program about tiling a sphere with bent triangles called Kaleidoscope, but the real treasure of the day was the source code to a GLUT program while lets you Build your own fractal planet (link to code is at the bottom; requires you to make two changes: "#include <GLUT/glut.h>" instead of "#include <GL/glut.h>" and #defines for TRUE and FALSE).

WARNING! I caused a kernel panic by trying to set the planet to too many triangles. Don't know how it's that easy... maybe a bug in GLUT?

--FÎanor

(P.S.: If you don't know how to make your own GLUT app project/target, it's really easy. Create an empty PB project. Add an application target. Add Cocoa, OpenGL and GLUT frameworks. Add source files. Make compatibility edits. Build&Run.)
Quote this message in a reply
Feanor
Unregistered
 
Post: #2
OH and if you like eye candy, check out IScape. (For those of you who drool over terrain, it's the sequel to the ROAM project.) The screenshots are astounding. FREE SOURCE! Don't think anybody's using it on Mac yet, but I can name a few commercial apps (<cough>everquest<cough>) that would be wise to dump their current terrain code and go with the algorithms in this project. In fact, I think its an LGPL library, so they could even use it in their app as is, and not have to open their own code.

Apologies to anyone who thinks this is on the wrong forum. If the mods want, they are welcome to move it where they like it. But I think now we can chat about terrain :-).
--FÎanor
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #3
Quote:Originally posted by Feanor
WARNING! I caused a kernel panic by trying to set the planet to too many triangles. Don't know how it's that easy... maybe a bug in GLUT?


Personally, I've found that its not as hard as it seems to cause a kernel panic... especially since my machine kernel panics everytime I try to do a find in Sherlock.

Cheers
Rocco
Quote this message in a reply
Feanor
Unregistered
 
Post: #4
I'm going to go to bed right after this, but maybe while I'm asleep the Pacific hemisphere will help with a question.

The IScape application is GLUT, but it makes heavy use of advanced GL extensions. Since it is written for windows, it uses a batch of constants like PFNWGLGETPIXELFORMATATTRIBIVARBPROC. I've heard about these procedure pointer things, and the hassle it is for porting stuff to Mac.

Any suggestions? They've partitioned them off already, but the alternate OS is Linux, and the required symbols are simply left out. There's also a possibility that they are using gl extensions not available on Mac (or at least, not on my card Sad ).
Quote this message in a reply
Feanor
Unregistered
 
Post: #5
Quote:Originally posted by KittyMac
Personally, I've found that its not as hard as it seems to cause a kernel panic... especially since my machine kernel panics everytime I try to do a find in Sherlock.
I never had a single kernel panic until today, and I've been using OS X since 10.0.4 almost non-stop, and non-stop since 10.1--literally. I never shut down my computer (except for thunderstorms and new system updates).

I've had finder freezes in 10.1 (there was an NVidia driver bug which cropped up with Quesa test apps, fixed in 10.2), but no panics. And I think I count as a heavy user who likes to push his system (what with developing, games, beta open source software like XDarwin and every other blessed thing). This came as quite a surprise to me.
Quote this message in a reply
Feanor
Unregistered
 
Post: #6
I've posted a PB project which collects some different terrain demos. You should be able to just click "Run & Build" on three of them and they will just work. The other two have issues (lScape -- no iScape as I said before -- and glBase are both using same core code, which has not been ported, but with it all in one package you can browse it easily).

The new ones not previously mentioned are from Mini Terrain project. This was already in a form compatible with OS X -- all I did was make an application out of it. What I found was cool about PB was that if you include data in a project, it gets put in the right place for the app to find it. It may not be done "properly" but it works.

There is another example app on the mini homepage, but it uses a big (16MB) data file that I didn't want to host.

see
my .Mac page and go into NotMyWork folder. Download TerrainPack.dmg. The project is actually called "Planet", named after first sub-project added.
Quote this message in a reply
Founder
Posts: 1,138
Joined: 2002.04
Post: #7
You should package these up and search the net for more of these and send them in to us so we can host them. This way they will always be easy to find. When you send them, make sure to inlcude the text file that contains their license (ie GPL, etc), abstract (who was the original author/dev, their link or email and a short explanation of what the download does.)

Cheers

Carlos A. Camacho,
Founder
iDevGames
Quote this message in a reply
Feanor
Unregistered
 
Post: #8
Carlos,
I'd be happy to scour for more. Hosting them here saves on my .Mac storage limit. I guess it would be best, then, if I separated the projects somewhat. There's basically three groups, totalling five programs, in that one package right now. Should I remove superfluous Non-Mac project files? Maybe I should just leave all the files together, and simply add the PB project. Usually they come with all the readme and license files already. How do I submit them?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sample Code Apple removed? SaxMan 12 6,583 Jan 17, 2009 05:26 PM
Last Post: AnotherJake
  FBO sample code posted arekkusu 5 4,632 Sep 20, 2006 09:23 PM
Last Post: Frank C.
  How to read an iTunes playlist, sample code TomorrowPlusX 4 5,097 Sep 9, 2005 11:06 PM
Last Post: LongJumper
  TextureRange sample Red Marble Game 1 2,930 Dec 9, 2004 12:04 PM
Last Post: arekkusu
  SpaceTime 3D Screen Saver (Free Source Code) ppinter1 11 5,686 Jan 4, 2004 03:06 PM
Last Post: arekkusu