THB-Splines with G+Smo

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

THB-Splines with G+Smo

Post by andrecaldas »

There is a library for "geometric design" called G+Smo (gismo). It handles the so called "splines", like B-Splines and NURBS.

I have written a very simple app that creates an Ogre ManualObject form a THB-Spline.
https://github.com/andre-caldas/minimal_ogre

I also used it to test my SDL3 Ogre implementation. So, unfortunately, it only works with my Ogre branch:
https://github.com/andre-caldas/ogre/tr ... NativeType
(I will make another post about it)

Anyway, I was just practicing how to create a ManualObject. This was my first working Ogre app. I don't really know how to do much. I am working on a CAD software that will use G+Smo and Ogre for rendering. I don't know if the community has any interest.

I plan to, some day, properly implement ManualResourceLoader and LOD.

Also, if anyone can (or knows how to) make it look sexier... with materials, light sources, etc... any help is appreciated. :-)

In my case, the window appears with zero size, so you have to resize it. And the controls you can use are:

  1. Arrows to move the object.
  2. WASD to rotate the object.

Image

Image

Image

paroj
OGRE Team Member
OGRE Team Member
Posts: 2108
Joined: Sun Mar 30, 2014 2:51 pm
x 1134

Re: THB-Splines with G+Smo

Post by paroj »

cool! did you see createBezierPatch and the according sample?

andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

Re: THB-Splines with G+Smo

Post by andrecaldas »

paroj wrote: Tue Sep 24, 2024 2:32 pm

cool! did you see createBezierPatch and the according sample?

Wow! No, I didn't. It seems I just have to follow this. I will start studying.

Do you (any of you Ogres) have any comments on this code? I mean, things you think are missing or that you would do in a different way. Or things like that...

andrecaldas
Halfling
Posts: 54
Joined: Mon May 06, 2024 1:06 am
x 3

Re: THB-Splines with G+Smo

Post by andrecaldas »

paroj wrote: Tue Sep 24, 2024 2:32 pm

did you see createBezierPatch and the according sample?

In this case, createBezierPatch() is a member of MeshManager. It creates a new PatchMesh passing to it the result of getNextHandle(). This, however, is a protected MeshManager method.

What is the proper way to do it from outside MeshManager?