realbasic-nug
[Top] [All Lists]

Re: OpenGL vs RB3D

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: OpenGL vs RB3D
From: Thomas Moore <tmoore at pomona dot edu>
Date: Tue, 30 Oct 2007 09:33:49 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <521152 dot 50331 dot qm at web61111 dot mail dot yahoo dot com> <9F87F783-72A7-4D0B-8780-62FB3BBACD15 at pomona dot edu> <025398FA-01CD-41B8-9143-FFFE7C494547 at inspiringapps dot com>
>> Here is the basic code for creating a sphere:
>>
>>    dim modelCode as string
>>    modelCode = "3DMetafile ( 1 6 Normal tableofcontents0> )" + CR
>>    modelCode = modelCode + Tab + "Container (" + CR
>>    <snip...>
>
> Actually, I'd say this is the *complex* code for creating a
> sphere.  :)  All those carriage returns and tabs are not necessary --
> when creating a 3DMF file by hand in a text editor, they're commonly
> used just to neaten things up, but (unlike REALbasic), Quesa doesn't
> care about whitespace, and to use them in code like the above just
> makes the code LESS readable rather than more.
>
> So, start by deleting all those, and the code will already be much
> simpler.
>
> The next step I might suggest is to put a template of the string into
> a string constant, with replacement keys where you want to customize
> it -- you know, "#RAD" for the radius, "#RED" for red, etc.  Then
> your code would look like this:
>
>    modelCode = kSphereTemplate
>    modelCode = ReplaceAllB( modelCode, "#RAD", Str(radius) )
>    modelCode = ReplaceAllB( "#RED", Str( clr.Red / 255 ) )
>    modelCode = ReplaceAllB( "#GRN", Str( clr.Green / 255 ) )
>    modelCode = ReplaceAllB( "#BLU", Str( clr.Blue / 255 ) )

Thanks, Joe, these are very helpful suggestions. So a simple space  
character will do between
>
>> Alternatively, you can go to my website
>>
>> http://www.physics.pomona.edu/sixideas/sicpr.html
>>
>> download the source code to either the 3DEField or 3DBField programs,
>> and look at the PD3D classes. This set of classes are useful for
>> creating "pre-defined" simple objects (colored spheres, cones,
>> arrows, etc.) as well as a viewing window with coordinate axes, with
>> hooks for zooming and rotating the view.
>
> That sounds pretty neat.
>
> Cheers,
> - Joe
>
>
> --
> Joe Strout
> Inspiring Applications, Inc.
> http://www.InspiringApps.com
>
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

-------------------------------------------------------------
This message has been scanned by Postini anti-virus software.

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


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