Manual Geometrik Mesh Generator

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Manual Geometrik Mesh Generator

Post by sphinkie »

Hello guys

I was looking for a piece of code to create planets during runtime.
I have used the MeshSphere written by snowblind in the wiki.
And modified it to create geospheres (better for planets, because of the pole texturing management).

I have created a generic class named GeometricMesh that can be derived into Mesh_Cube, Mesh_icosa, Mesh_sphere, and other simple shapes.

Then I have created a generic class named Geodesic that can be derived into Mesh_GeoSphere, Mesh_Geoellipse and other complex geodesic shapes (class 1 and class 2 shapes).

My question:
- Do you think this can be usefull to someone, and this is worth to be shared ?
- As there are many files, what is the best way to share it ? (wiki is not very appropriate for 10/12 files, I believe).

I can add some screenshots if necessary.

Thanks
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You could include some snippet examples / headers in the wiki and upload the full source as a zip, the wiki supports file uploads.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Sphinkie, this is definately wanted! :D
It goes directly into OgreOpcode. :D
If I may. :)

And OGRE Wiki of course. :wink:
If you think so. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Yes, that sounds very useful sphinkie, please wikify it.

Cheers!
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

jacmoe: yes, you can use it for ogreopcode, but wait a little bit maybe, because I have to clean the code first ...

I have created the wiki page here, http://www.ogre3d.org/wiki/index.php/GeometricMesh
but it's not finished yet.... I'll need a few days .
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

sphinkie wrote:jacmoe: yes, you can use it for ogreopcode, but wait a little bit maybe, because I have to clean the code first ...
Unclean code fits right into OgreOpcode! :P
Could be very cool to have this in RC1 (to be released by the end of May). :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

OK: I am posting the sources files today (in the wiki) but be aware that this is not a final version.

I have called it WIP-01 and be aware that some comments will not be up-to-date, and that the source files may contain some functions or class that are unused...

The source files are doxygen compatible.

With this, you can have an an idea of what the library can do, and how to integrate it in your projet.
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

Well, it is done.

The version 1.0 is now available on wiki.
http://www.ogre3d.org/wiki/index.php/GeometricMesh

Enjoy
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Wow, this is really appreciated! :)
Looking forward to tinker with that code.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
batomaeus
Kobold
Posts: 33
Joined: Fri Jun 23, 2006 1:21 pm
Location: St. Augustin, Fraunhofer Institute for Autonomous Intelligent Systems, Germany
Contact:

Post by batomaeus »

Hi!
I experienced problems with the sphere class. There are some rays flickering nervously around. Here are two screenshots:

Image
Image

Do you know why that could occur?
Greets
Enter any 11-digit prime number to continue...
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

wireframe seems OK.

in the first view, all the rectangles are inexpected, or some of them are yours ?
User avatar
batomaeus
Kobold
Posts: 33
Joined: Fri Jun 23, 2006 1:21 pm
Location: St. Augustin, Fraunhofer Institute for Autonomous Intelligent Systems, Germany
Contact:

Post by batomaeus »

no, i didn't change the code (except that I commented lines like
TRACE(". mTriangles["+ITOA(index)+"].cornerA = "+ITOA(i));
out, because my linux-compiler didn't like the ITOAs).
For me, both pictures seem to be not OK: The rays in the wireframe-pic that radiate from the center of the sphere are not intended, they were generated from the sphere-class (as well as the rects in the first view). They are also flickering. Strangely, these rays (and also the surfaces if wireframe is not activated) are sometimes there, sometimes they dissapear - this also depends on the initial position of the camera.
Enter any 11-digit prime number to continue...
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

strange...
I didn't see these artefacts before.
I just remember there is a bug with some even frequencies.
Also, I am using Ogre 1.2.0 with MS-windows.

Also, now, with the new functionnality of Ogre (called "MeshFactory" if I remember well), this component could surely be rewritten more efficiently.

Sorry, but I can't help you more, I'm leaving for 1 month holydays....
:D
big_o
Goblin
Posts: 279
Joined: Sun Feb 19, 2006 1:08 am

Post by big_o »

Unclean code fits right into OgreOpcode!
:D

I've been using the old sphere code form the wiki for the same purpose, but now I might give this method a try!
MKM
Gnoblar
Posts: 4
Joined: Thu Feb 01, 2007 2:52 pm
Location: France, Rennes

Post by MKM »

It sounds pretty interesting but the link to the zip file seems to be dead. Could someone give a mirror link ?

Thx
User avatar
sphinkie
Greenskin
Posts: 114
Joined: Wed Jul 07, 2004 11:08 am
Location: Paris
x 1
Contact:

Post by sphinkie »

link corrected
User avatar
detox
Greenskin
Posts: 103
Joined: Thu Sep 07, 2006 1:13 am
Location: Ohio, USA
Contact:

Post by detox »

Thank you for sharing the code. I know I'll find it very useful.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

batomaeus wrote:no, i didn't change the code (except that I commented lines like
TRACE(". mTriangles["+ITOA(index)+"].cornerA = "+ITOA(i));
out, because my linux-compiler didn't like the ITOAs).
For me, both pictures seem to be not OK: The rays in the wireframe-pic that radiate from the center of the sphere are not intended, they were generated from the sphere-class (as well as the rects in the first view). They are also flickering. Strangely, these rays (and also the surfaces if wireframe is not activated) are sometimes there, sometimes they dissapear - this also depends on the initial position of the camera.
This tends to happen if the vertex buffer is larger than what goes into it (so vertices are created from random data), or some buffer overflow occurs. For example, rendering a larger range than represented the vertex buffer.

You should check the buffer sizes, draw ranges etc...
howfine
Gnoblar
Posts: 5
Joined: Fri Oct 12, 2007 3:06 pm

Manual Geometrik Mesh Generator

Post by howfine »

The source code cannot download!
Can you send it to my email:howfine@126.com.
Thank you very much!
radman
Gnoblar
Posts: 6
Joined: Tue Jan 06, 2009 2:30 am

Re: Manual Geometrik Mesh Generator

Post by radman »

Better, can you give a real, useable link for the rest of the community?

Thanx in advance.
zuur
Halfling
Posts: 63
Joined: Wed Feb 06, 2008 1:02 am

Re: Manual Geometrik Mesh Generator

Post by zuur »

The link to this code appears to be broken (again by the looks).. Does anyone have a link to it that works still, or a copy of the code?

jacmoe, did you end up getting a copy of this for Ogre Opcode? (I downloaded the latest Ogre Opcode source, but couldn't see it there) :(

Any help is *really* appreciated..

Thanks,
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Manual Geometrik Mesh Generator

Post by jacmoe »

Unfortunately not :(
I am not even sure if I've got it lying around somewhere, but I'll keep it in mind..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
zuur
Halfling
Posts: 63
Joined: Wed Feb 06, 2008 1:02 am

Re: Manual Geometrik Mesh Generator

Post by zuur »

Anyone?

Any ideas on where else to look to find code to generate a geometric sphere?
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Manual Geometrik Mesh Generator

Post by xavier »

DX SDK sample code? Haven't checked but there's a lot of good code in there...
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
zuur
Halfling
Posts: 63
Joined: Wed Feb 06, 2008 1:02 am

Re: Manual Geometrik Mesh Generator

Post by zuur »

okay, thanks for the feedback guys - I'll have a look through the DX SDK.
Post Reply