View previous topic :: View next topic |
Author |
Message |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Thu Jul 16, 2009 12:49 pm Post subject: |
|
|
that ok
By the way XmlPath kicks ass ! And is very fast ! I'll definitivly use it.
What I've donne so far : I almost understant how collada stores the data and I thinking off writting a bool function to load the data
Code: |
bool load(char[] filename)
{
Load everything interesting from the .dae
}
|
I also put an eye in the code and hell I don't see any declaration of struct for storing vertex edges faces info maybe I don't have the lastest source So I'll set myself those data structs
Where did you declare the Vec3f data in what file ? |
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Thu Jul 16, 2009 8:45 pm Post subject: |
|
|
Triangle data (data that stores references to vertices) is stored in yage.resource.geometry.Mesh (line 270). Geometry may have one or more meshes, so multiple Meshes may index into a single vertex array.
I hope to eventually also support triangle stripes and triangle fans for performance and reduced memory, but for now I only support individual triangles. Line 268 is the constant that represents this mode.
All Vec** structs are defined in yage.core.math.vector. There's a templated struct here that defines the type and number of members for the vector. Unfortunately, I haven't been able to get rid of Vec3f (defined below this) into it because dmd gives me forward reference errors. I admit I haven't tried in over a year though.
If your curious why I have the vertex data setup as an associative array (line 168: IVertexBuffer[char[]] attributes), it's so that different geometry can have different per-vertex attributes, and even custom attributes, which are needed for certain shaders (like bump mapping).
Also, if you have something half completed that compiles, and it doesn't break anything else, feel free to commit it. Thanks again for working on Collada support. Hopefully I can help with other features needed for your racing game later on. |
|
Back to top |
|
|
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Sat Jul 18, 2009 3:19 pm Post subject: |
|
|
I've just finished the bool load function only for static mesh Now time to see if it do what I want Soon the v0.4 for Yage 3D
By the way how I send you what i've done ? It's the first time I use SVN |
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Sun Jul 19, 2009 10:15 am Post subject: |
|
|
If you're on windows, you can install tortoise SVN for a nice GUI. Right click on a folder in windows explorer, go to svn checkout and enter http://svn.dsource.org/projects/yage/trunk as the repository url. This will bring all of the site files into that folder. You can then add your changes there, right click on the top folder of the site, and go to SVN commit. Later, if you need get the latest version from the repository, go to SVN Update. If we've both changed the same lines of a file, you might get an svn conflict, but we can go over that if/when it happens.
On Linux, I use subclipse, wich is a plugin for eclipse, but I know there are other solutions out there, and there's always the command line svn.
If you can't get these working, you can just email your additions to me in a zip file and I'll merge them in. |
|
Back to top |
|
|
nepser
Joined: 18 Sep 2009 Posts: 2 Location: France
|
Posted: Fri Sep 18, 2009 8:10 pm Post subject: |
|
|
Ho hay!
I recently discovered D langage throught Tanukisan and Yage3D project. Here is some reflexions about loading .dae files and your actual OO conception.
First of all, a COLLADA file is a scene descriptor, witch include as you can see internal format for meshes/materials/texture... Therefore it does not match your conception of "ressource loaded by it's own file" and also "ressource named by it's filename". Luckly .dae could also reference to foreign ressources files and follow your first conception.
In order to maintain the stability of your conception, I advocate to add a "load" method in your scene object (and a call of this in a constructor with a string argument) witch could build freely meshes or stuff witch says no colladaLoader object.
But, it could be a way to make this colladaLoader object for geometries... a slower way witch consists to have a 2 argument method load. One of them would be the filename (that will be reparsed :s) and the second, the entity id to load. It's cleaner, but I think much slower.
However I asume it could be reused for another file type...
Witch way do you prefer? |
|
Back to top |
|
|
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Fri Sep 18, 2009 8:32 pm Post subject: |
|
|
Hello,
I had considered supporting the ability to load an entire scene from a collada file, or perhaps using it as a file format for levels as well, but individual 3d models is the easiest first step.
Having the entity id as a second argument to model's load is a good idea. Any speed issues could be resolved by having one entity (model) per collada file, which seems to be the way most engines do it. Perhaps it could default to the first model found if an entity-id isn't specified.
BTW, I'm currently in #yage on irc.freenode.net and plan to be (off and on) for the next 4-5 hours. |
|
Back to top |
|
|
nepser
Joined: 18 Sep 2009 Posts: 2 Location: France
|
Posted: Sat Sep 19, 2009 6:32 am Post subject: |
|
|
Quote: | Having the entity id as a second argument to model's load is a good idea. Any speed issues could be resolved by having one entity (model) per collada file, which seems to be the way most engines do it. Perhaps it could default to the first model found if an entity-id isn't specified. |
Sounds good.
Note: I'm in France, it's hard for me to stay from 3am to 8 am on IRC :p
But I'll stay on the chan in case... |
|
Back to top |
|
|
|
|
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 You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|