realbasic-games
[Top] [All Lists]

Re: 3D graphics in RealBasic

To: "REALbasic Games" <REALbasic-Games at lists dot realsoftware dot com>
Subject: Re: 3D graphics in RealBasic
From: Nick Lockwood <nick dot lockwood at ntlworld dot com>
Date: Thu, 26 Feb 2004 12:14:14 +0000
References: <20040225222132 dot 9A22B26B6C at email dot engr dot smu dot edu> <F20508F0-6820-11D8-A976-000A95B1A710 at engr dot smu dot edu> <038483F6-682C-11D8-9A76-000A95E68466 at tinrocket dot com>

On 26 Feb 2004, at 07:18, John Balestrieri wrote:

Without high level scene graph management and "object" support, OpenGL is next to useless for game dev. Not to mention no collision support... Imagine something like the Rb Graphics object that can draw in 3D and you get an idea of what raw OpenGL is.

Yes exactly, which is a brilliantly intuitive way to do 3D. In fact I've made a GLCanvas class in RB which implements a GLPaint event that is called whenever it needs to be redrawn. Just put your gl drawing code in the event and voila, a RB canvas that draw 2D graphics about a 1000 times faster than the standard one (conservative estimate) and can do 3D as well just as easily.

Of course for more complex projects you need some higher level stuff like meshes, and at that point you need to add polygon sorting routines to handle translucent polygons correctly and suddenly things get a bit trickier. But these routines are not actually hard to write and someone at RS need only do it once and everyone could either use it, or implement their own if they weren't happy with the "official" implementation.

Trust me, we may not like Quesa, but it was the logical choice for Rb without investing 1000s of man hours to reinvent the wheel.

I don't see why. I've tried doing stuff with Quesa declares and it is a much more complex process than achieving things in OpenGL. I can see that at some point you probably hit a tradeoff where the dozens of Quesa declares become less work than the hundreds of lines of your own code needed to achieve the same thing in OpenGL, but to be honest I prefer writing a hundred lines of object-oriented REALbasic code that I understand and can modify to writing dozens of lines of Quesa declares that use obscure data structures that I have to painstakingly look up on the internet and then hand-build in a memoryblock, all the time knowing that if I want to change any of those parameters I'll have to look it all up again.

That said, I've been working on the high level stuff in Rb for a *very* long time & if Rb one day is able to compile Rb plugins, I will share what I'm working on. Others are working on the same things using OpenGL at this very moment and I think all of them know that OpenGL all by itself is not going to solve anyone's problems.

It has solved mine. My project is only very simple - a 2D game that I've enhanced with some 3D effects because OpenGL gave me the power to do so - but I really believe I could not have done it either with ordinary RB drawing routines or with RB3D. A typical example of why would be the issue of turning an RB picture into a Quesa texture. This has an overhead *seconds* in RB3D, and once it is done the resulting data structure is totally incomprehensible. In my game I use OpenGL to take a screenshot of the game and map it onto a polygon immediately, between frames. What's more, the data format for OpenGL images is so trivial that you can access it at a pixel level as easily as using an rgbsurface, and considerably faster.

If you want OpenGL now, there's nothing to stop you from downloading a project with practically every OpenGL declare and you can start programming away. I can (thankfully) attest that Rb will get in your way! :)

Do you mean *won't*?

Nick


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>