Closed Lathreas closed 3 years ago
I've added a UVMesh class, which contains both the VBO and IBO, such that it is no longer possible to get varying resolution from one object when running GenerateMesh(). I also examined the possibility of making the internal functions GenerateIndexList and GenerateVertexList private instead of public, but it seems we'll need to be able to access these functions separately when only one of the two lists is needed, such as when regenerating only the vertices (then the indices would remain the same). There are more elegant solutions than that, but in order to pick the best one we need to know a bit more about how the rest of the code is set up, so I think I'll keep it at this for now and revisit later if needed.
Sorry for the huge amount of deletions, that was due to removing the Unity Project to allow it to compile. If that's not wanted (e.g. if a renaming would be preferred) just let me know, but considering we'll be using Godot from now on I suppose this is the cleanest way.
I also set up the Godot project and opening it in the latest version of Godot-with-mono (for C# support), it should compile and run. I'll post some instructions on how to set Godot up on Linux in a minute.
The files in the "gui/" folder are placeholders, they serve as an example of how to render a bone. Feel free to change, rename or remove them later on when you're working on the GUI and no longer need them.
Merging with 1 approval
Hey all!
I've added some basic classes and a simple test geometry which can serve as the base of the rest of the engine. It's not completely finished, of course, as the
Character.cs
,Species.cs
and anatomy files need to be expanded a lot more and some other classes also need to be properly implemented.The folder structure is intended to be as follows (things in parentheses are not yet included):
In
geometry
, all (abstract or real) mathematical geometric objects are defined, such as cylinder surfaces, hemispheres, and various curves. Inanatomy
, all physically relevant derived classes ofBodyPart
can be found, so these are basically the basic elements of the full anatomic model. Inrenderable
I intended to put a general class that can be sent to whatever render engine we use, but it's currently not used yet and alternative methods exist for now.Character.cs
andSpecies.cs
will ultimately serve as the containers for the full model as per Luna's recommendation. This is of course not yet implemented, but hopefully we will get to that soon.This code is currently capable of generating the base meshes required for rendering. It defines the abstract mathematical representation of a point (Vertex.cs), a simple curve (Line.cs) and several surfaces (Cylinder.cs, Hemisphere.cs, Capsule.cs). A capsule is a cylinder with two hemispheres placed on top.
I tested the code to see if it outputs something sensible as VBO and IBOs, but I haven't been able to test it fully rendered yet, so it likely contains some bugs still. Depending on the coordinate system used by the render engine, I might have flipped the normals, so then it would render inside-out. Should be easy to fix once we know that, though.
In
Main.cs
there's a simple example showing how to use the system so far. It generates a Character that contains a single bone and a single joint. One can get the mesh (VBO+IBO) for each BodyPart by invoking theGenerateMesh
method of the geometric surface, as can be seen inMain.cs
. Feel free to suggest improvements in coding style, implementation or project structure!