View previous topic :: View next topic |
Author |
Message |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Wed Jul 01, 2009 4:47 pm Post subject: Can I join the devteam ? |
|
|
Thanks you Joe for replying me actually there a lot of work to do with my engine... Start from the very begining, it would be better if I join you for both of us... But I rather warm you I dont have very good skill in 3D programming my project was to learn how it works. For now I can show you that I've written so far therefore you can judge yourself my level.My code is clear and well documented. Moreover I've got good modelling skills so you'll hit 2 birds with one stone
I'm looking forward your answer ![Wink](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Thu Jul 02, 2009 10:42 pm Post subject: |
|
|
Sure, so long as you're willing to submit your code under a license such as the MIT, BSD, Zlib/PNG, or similar. I've given you svn commit permissions to the code.
I have a list of possible tasks here but those are just ideas, so don't let that limit you. I've been working on user interface code lately. Beyond that, support for collada models is probably the biggest thing that Yage needs right now, but that could be a big task in itself. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Fri Jul 03, 2009 9:01 am Post subject: |
|
|
I forgot to mention the roadmap. Collada (so Yage can have decent model support), terrains, and physics are probably the main features that are needed for the type of stunt racing game you mentioned on the ng. But like I said, feel free to work on whatever part inspires you. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Fri Jul 03, 2009 1:29 pm Post subject: |
|
|
Ok that's great.... I will implement the collada support but so far I have no idea about it's internal working so it'll take a little time to understand the format but I'll do my best ! I also maybe need your help to understand the engine... Collada support is my priority ![Wink](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Fri Jul 03, 2009 1:49 pm Post subject: |
|
|
Right now yage has support for the Milkshape 3d model format, which is a rather poor format and can only be made with a non-free program. It also has partial support for .obj files, which is a step up, but Collada has become quite universal in the last few years and supports far more features than either of those.
There's an open source library called fcollada that some use, but collada is basically just xml, so it might be more portable to just use Tango's xml parsing for it.
Here is an example of a collada file. This is the default scene in blender, a cube in the center, a light source, and a camera. Obviously we're only interested in the geometry and material parts for now. Perhaps physics properties can come later, dunno.
If you get into this and decide it's not for you, feel free to look into anything else that you find interesting.
Code: |
<?xml version="1.0" encoding="utf-8"?>
<COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
<asset>
<contributor>
<author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
<authoring_tool>Blender v:246 - Illusoft Collada Exporter v:0.3.159</authoring_tool>
<comments></comments>
<copyright></copyright>
<source_data>file://</source_data>
</contributor>
<created>2009-07-03T15:41:47.620502</created>
<modified>2009-07-03T15:41:47.620549</modified>
<unit meter="0.01" name="centimeter"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_cameras>
<camera id="Camera-Camera" name="Camera-Camera">
<optics>
<technique_common>
<perspective>
<yfov>49.13434</yfov>
<znear>0.1</znear>
<zfar>100.0</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_effects>
<effect id="Material-fx" name="Material-fx">
<profile_COMMON>
<technique sid="blender">
<phong>
<emission>
<color>0.00000 0.00000 0.00000 1</color>
</emission>
<ambient>
<color>0.40000 0.40000 0.40000 1</color>
</ambient>
<diffuse>
<color>0.80000 0.80000 0.80000 1</color>
</diffuse>
<specular>
<color>0.50000 0.50000 0.50000 1</color>
</specular>
<shininess>
<float>12.5</float>
</shininess>
<reflective>
<color>1.00000 1.00000 1.00000 1</color>
</reflective>
<reflectivity>
<float>0.0</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.0</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_lights>
<light id="Spot" name="Spot">
<technique_common>
<point>
<color>1.00000 1.00000 1.00000</color>
<constant_attenuation>1.0</constant_attenuation>
<linear_attenuation>0.0</linear_attenuation>
<quadratic_attenuation>0.0</quadratic_attenuation>
</point>
</technique_common>
</light>
</library_lights>
<library_materials>
<material id="Material" name="Material">
<instance_effect url="#Material-fx"/>
</material>
</library_materials>
<library_geometries>
<geometry id="Cube-Geometry" name="Cube-Geometry">
<mesh>
<source id="Cube-Geometry-Position">
<float_array count="24" id="Cube-Geometry-Position-array">1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000 1.00000 1.00000 -1.00000 1.00000 -1.00000 -1.00000 1.00000 -1.00000 1.00000 1.00000</float_array>
<technique_common>
<accessor count="8" source="#Cube-Geometry-Position-array" stride="3">
<param type="float" name="X"></param>
<param type="float" name="Y"></param>
<param type="float" name="Z"></param>
</accessor>
</technique_common>
</source>
<source id="Cube-Geometry-Normals">
<float_array count="18" id="Cube-Geometry-Normals-array">0.00000 0.00000 -1.00000 0.00000 -0.00000 1.00000 1.00000 -0.00000 0.00000 -0.00000 -1.00000 -0.00000 -1.00000 0.00000 -0.00000 0.00000 1.00000 0.00000</float_array>
<technique_common>
<accessor count="6" source="#Cube-Geometry-Normals-array" stride="3">
<param type="float" name="X"></param>
<param type="float" name="Y"></param>
<param type="float" name="Z"></param>
</accessor>
</technique_common>
</source>
<vertices id="Cube-Geometry-Vertex">
<input semantic="POSITION" source="#Cube-Geometry-Position"/>
</vertices>
<polygons count="6" material="Material">
<input offset="0" semantic="VERTEX" source="#Cube-Geometry-Vertex"/>
<input offset="1" semantic="NORMAL" source="#Cube-Geometry-Normals"/>
<p>0 0 1 0 2 0 3 0</p>
<p>4 1 7 1 6 1 5 1</p>
<p>0 2 4 2 5 2 1 2</p>
<p>1 3 5 3 6 3 2 3</p>
<p>2 4 6 4 7 4 3 4</p>
<p>4 5 0 5 3 5 7 5</p>
</polygons>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node layer="L1" id="Cube" name="Cube">
<translate sid="translate">0.00000 0.00000 0.00000</translate>
<rotate sid="rotateZ">0 0 1 0.00000</rotate>
<rotate sid="rotateY">0 1 0 -0.00000</rotate>
<rotate sid="rotateX">1 0 0 0.00000</rotate>
<scale sid="scale">1.00000 1.00000 1.00000</scale>
<instance_geometry url="#Cube-Geometry">
<bind_material>
<technique_common>
<instance_material symbol="Material" target="#Material">
<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node layer="L1" id="Lamp" name="Lamp">
<translate sid="translate">4.07625 1.00545 5.90386</translate>
<rotate sid="rotateZ">0 0 1 106.93632</rotate>
<rotate sid="rotateY">0 1 0 3.16371</rotate>
<rotate sid="rotateX">1 0 0 37.26105</rotate>
<scale sid="scale">1.00000 1.00000 1.00000</scale>
<instance_light url="#Spot"/>
</node>
<node layer="L1" id="Camera" name="Camera">
<translate sid="translate">7.48113 -6.50764 5.34367</translate>
<rotate sid="rotateZ">0 0 1 46.69194</rotate>
<rotate sid="rotateY">0 1 0 0.61977</rotate>
<rotate sid="rotateX">1 0 0 63.55930</rotate>
<scale sid="scale">1.00000 1.00000 1.00000</scale>
<instance_camera url="#Camera-Camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<library_physics_materials>
<physics_material id="Cube-PhysicsMaterial" name="Cube-PhysicsMaterial">
<technique_common>
<dynamic_friction>0.5</dynamic_friction>
<restitution>0.0</restitution>
<static_friction>0.5</static_friction>
</technique_common>
</physics_material>
</library_physics_materials>
<library_physics_models>
<physics_model id="Scene-PhysicsModel" name="Scene-PhysicsModel">
<rigid_body name="Cube-RigidBody" sid="Cube-RigidBody">
<technique_common>
<dynamic>false</dynamic>
<mass>0</mass>
<instance_physics_material url="#Cube-PhysicsMaterial"/>
<shape>
<instance_geometry url="#Cube-Geometry"/>
</shape>
</technique_common>
</rigid_body>
</physics_model>
</library_physics_models>
<library_physics_scenes>
<physics_scene id="Scene-Physics" name="Scene-Physics">
<instance_physics_model url="#Scene-PhysicsModel">
<instance_rigid_body body="Cube-RigidBody" target="#Cube"/>
</instance_physics_model>
</physics_scene>
</library_physics_scenes>
<scene>
<instance_physics_scene url="#Scene-Physics"/>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>
| [/code] |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Fri Jul 03, 2009 4:24 pm Post subject: |
|
|
I think I will use FCollada to write the yage collada parser... Would it not be better to just write a "perso" collada exporter I mean a parser which read any .dae file but only focuses on what matter to us I mean geometry , materials and texture (latter will come animation ). To me a 3D format should not hold any "visual" data such as info on light camera etc since you get better result by programming those visual data.
By the way can you send me the part of yage which focuses on the rendering part. Will I have to write a exporter for collada data structures match with yage data structures or it's the same ? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Fri Jul 03, 2009 5:23 pm Post subject: |
|
|
We should make sure that fcollada can do what we need. For example:
The website says that fcollada is a c++ library, but D1 can only interface directly with c code. Would a wrapper need to be written?
From quick googling, it seems that fcollada works on windows and linux (the same places that yage works), but does it also support mac? I would like to get yage working there eventually.
Under what license is fcollada released? Is it compatible with yage's LGPL license?
I agree about disregarding light and camera info in the 3d model format. I think collada supports multiple models per file so maybe it would eventually be a good format for storing level info, but we probably don't want to worry about that now.
As for rendering, you shouldn't need to touch any of that code. Yage's geometry data structures are stored in yage.resource.Geometry. Geometry is used for all types of 2d/3d data, such as user interface, terrains, 3d models, sprites, etc. There's also yage.resource.Model which inherits from Geometry and implements more advanced features such as skeletal animation. As long as you can get the collada data loaded into a Model, the renderer will take care of the rest.
The materials system is rather outdated and I hope to rewrite it at some point. Currently, materials are divided into layers (which are separate rendering passes), and layers are divided into textures and shaders. I haven't yet decided how to rewrite it, but since Collada supports such a wide variety of material effects, I'm thinking about making yage's internal material system match it. What do you think? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Sun Jul 05, 2009 4:59 pm Post subject: |
|
|
Ok serious things start now. I've downloaded Collada specification and I give me one week to understand the internal working of Collada and then start to code the needed function by the 15 jully. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Sun Jul 05, 2009 9:03 pm Post subject: |
|
|
I appreciate it. No stress though, take your time. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Wed Jul 08, 2009 5:22 pm Post subject: |
|
|
I'm back with some doubts
1) Where do you specify some very general data structures I mean I started to see/watch the code and I noticed that your data structs where defined in terms of the data structs of ms3d and obj ( Or maybe I just did not find them ). What do you think about setting very general data struct and make it match to collada struct so if we want to add the support of a new 3D format we'll juste have to write only the part which gather an exchange the data struct and not a whole parser. For me those general data should be vertex info faces index info edges index info textures info and color info with interconection between the struct for instance to render a triangle
Code: |
glBegin(GL_TRIANGLES);
for(int i = 0;i < 3;i++)
{
vertex.x[face[i]];
vertex.y[face[i]];
vertex.z[face[i]];
}
glEnd();
|
Need your approval to go further
I started to read Collada specification and I find that this format is very intuitive and understandable fairly easily
For now I've interest only in static mesh properties
By the way I wanted to export the .dae in a yage data strucs by using the C function mmap. What do you think about it ? is there any equivalent in D ? Have you got better ways to gather the information ? I'm open to any comments you got ! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Thu Jul 09, 2009 8:10 am Post subject: |
|
|
I'll reply in more detail later when I have more time. But briefly: The OBJ and Ms3d structs that you've seen are just temporary structs to help with loading those formats. The final result goes into the classes in yage.resource.geometry, which are the general version used by the renderer and elsewhere in the engine. What you'll find there closely matches your code sample. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Thu Jul 09, 2009 1:12 pm Post subject: |
|
|
ok take your time to answer me I'll wait |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Sat Jul 11, 2009 8:38 pm Post subject: |
|
|
Sorry about the delay--it's been an extremely busy week.
tango.io.device.FileMap has the equivalent of c's mmap, but tango.text.xml would be 10 times easier. There's also yage.core.xml, but I put that in long before Yage started using tango, and tango's should be a lot faster and more feature-complete. (I hope to remove it eventually). From there you can use tango.util.Convert's to!() function to parse the text into integers and floats.
I also use Tango's xml parser in yage.gui.textlayout (around line 300) to allow Surface.text to accept and parse simple html, but tango's xml tutorial is a better guide.
More on Yage's geometry format:
yage.resource.geometry.Geometry stores multiple optional named vertex buffers. These vertex buffers store arrays of floats (1, 2, or 3) per vertex. a Geometry object also stores multiple meshes. Each mesh has an array of integer triangle indices (that index into the aforementioned vertex arrays), and a material.
yage.resource.Material is outdated and I think it would be better to come up with a new material class/classes that more closely matches Collada's. When I wrote it, I didn't plan ahead enough.
Hope this answers all of your questions. And let me know if you think any of this is the wrong direction. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Tanukisan
Joined: 27 Jun 2009 Posts: 13
|
Posted: Mon Jul 13, 2009 5:34 pm Post subject: |
|
|
Excuse me but is collada license fit the open source motto ? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JoeCoder
Joined: 29 Oct 2005 Posts: 294
|
Posted: Mon Jul 13, 2009 9:30 pm Post subject: |
|
|
Collada is an open standard. It's from the Kronos group, which is the same group behind OpenGL. I chose Collada because it's a very open format, supports many features, and is becoming a standard in the 3d art creation industry. Almost every 3d tool supports Collada--from blender to maya to google earth.
I hope this helps. Let me know if you have any more questions, or if you get stuck and need help. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|