Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 16, 2017 7:06 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue Apr 27, 2010 11:22 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Here you guys go, a class that should help everyone using opengl get things going quickly! All feedback is welcome :)

Download Version 1.7
Released: 5/28/2010

Download Version 1.6
Released: 5/20/2010

Download Version 1.5
Released: 5/19/2010

Download Version 1.4
Released: 5/11/2010
Note: GL_*_STRIPs will looks a bit awkward since culling has been disabled to show full rotations.

Download Version 1.3
Released: 5/8/2010

Download Version 1.2
Released: 5/6/2010

Download Version 1.1
Released: 5/5/2010

Download Version 1.0
Released: 4/27/2010

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Last edited by Blake on Fri May 28, 2010 8:20 pm, edited 9 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Wed Apr 28, 2010 8:37 am 
Offline

Joined: Mon Apr 16, 2007 3:12 pm
Posts: 154
Very useful Blake, thank you. I have learned a great deal about OpenGL from your examples.


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Sat May 01, 2010 2:30 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Your very welcome, I'm glad they are being useful :)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Wed May 05, 2010 7:52 am 
Offline

Joined: Fri Mar 03, 2006 2:25 pm
Posts: 33
Location: Arlington, VA USA
Nicely done Blake! Very helpful.

_________________
/r
-Jeff Hendrickson


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Wed May 05, 2010 12:39 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just released an updated version. Added a Scale method and cleaned up a couple of small items including being able to change the pitch (up/down) angle of the camera.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Thu May 06, 2010 10:44 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just released v. 1.2, here are some of the things that were added:

    AppendMesh() - You can add one mesh to another
    AlphaValue() - You can now get/set the alpha value at each vertex, this is based on 0 = Opaque, 255 = Transparent
    AutoCheckAlpha [Default: True] - You can have the mesh class set the alpha value to Opaque by default when setting a color

Edit: Forgot to add that I added support in the Render method for glDrawRangeElements. You can specify what the lowest/highest vertex you will call within the passed Indices (if not drawing the entire mesh), this gives room for optimization in the video card due to a smaller amount of memory needed.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Sat May 08, 2010 9:29 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just released v 1.3, here are the things that were added:

    Attach() - You can combine one mesh with another
    Copy() - Returns a copied version of the mesh, you can pass a start/count value to get just a portion of the mesh
    Detach() - Returns the the mesh requested by the start/count values and removes the portion from the mesh.
    Duplicate() - Copies all of the properties from the passed mesh.
    IndicesInRange() - Returns a memoryblock with the range of index values requested by the start/count parameters
    Move() - Moves the mesh by the passes x, y and z values. Optional parameters of Indices so you can move only a portion of the mesh if you wish.
    Remove() - Removes the portion of the mesh as requested by the start/count parameters.

Updates:

    Scale() - You can now pass an optional list of indices to be scaled if you do not want the entire mesh to be scaled.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue May 11, 2010 4:42 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just released version 1.4, added a Rotate function as well as cleaned up some notes.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Wed May 19, 2010 12:48 am 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Just released version 1.5, here are some of the things that have been updated or changed.

New:
    CalculateNormals() - The mesh class can now calculate its own normals, optional parameter is a list of Indices.

Updated:
    Rotate() - Rotations are now done via a rotation matrix, over 2x faster than previously coded.
    Scale() - Changed from one Scaler parameter to X, Y and Z parameters, you can specify how to scale each axis.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Wed May 19, 2010 3:17 am 
Offline

Joined: Mon Apr 16, 2007 3:12 pm
Posts: 154
Nice work Blake.


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Thu May 20, 2010 11:51 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Thanks :)

Just released version 1.6, here is what is new/updated

New:
    FocalPoint() - Returns the center point of the mesh or the optional list of indices
    GroupSetup() - If you are going to draw multiple pieces of the mesh begin with this to enable the proper client states
    GroupRender() - Does not set up any of the client states as Render() does, only does the drawing.
    GroupCleanup() - Disable the proper client states

Updated:
    IndicesInRange() - There was a small error in the looping that was causing there to be to many index values returned in the memoryblock

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Fri May 28, 2010 8:22 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Version 1.7 is up, changes:

Added:
    Rotatem() - Allows you to pass a OpenGLMatrix that already had the rotation matrix calculated.

Updated:
    Scale() - Added an optional origin parameter so you can scale around a point instead of always scaling around 0, 0, 0

Also the OpenGLMatrix class has been beefed up, enjoy :)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue Jun 01, 2010 9:27 am 
Offline
User avatar

Joined: Sat Oct 01, 2005 1:23 pm
Posts: 74
This is looking very good and useful. I'd like to see a LoadFromOBJ and SaveToOBJ method (in my copious free time I might write them...).

Have you considered hosting all this in an online open source repository like SourceForge or code.google.com?


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue Jun 01, 2010 3:21 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
I actually have OpenAsOBJ in the OpenGLModel class (which is currently under development) but if you want to write a SaveAsOBJ function I would be happy to include it (giving you full credit for it naturally).

As for the open source repository, I haven't really given it a thought mainly because I've never used them before.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue Jun 01, 2010 4:31 pm 
Offline

Joined: Fri Sep 30, 2005 9:16 am
Posts: 761
Blake wrote:
As for the open source repository, I haven't really given it a thought mainly because I've never used them before.


Doing so would make your managing of updates and us watching for them much easier.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group