Horde3D

Next-Generation Graphics Engine
It is currently 28.12.2024, 11:04

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 21.12.2011, 09:33 
Offline

Joined: 21.12.2011, 09:08
Posts: 3
Hi,

I'm a student, mostly doing compilers theory and parsing techniques, not game programming at all. I'm doing 3D programming for few weeks only, I got the basis of OpenGL from this tutorial, so this is the first engine I use.

I read the entire manual (http://www.horde3d.org/docs/manual.html), it seems very incomplete for me. Now I really don't see how to learn more, did I missed a link with a more complete documentation ? The best I can do is to use grep on the engine code (which is well commented by the way, but it's not very easy to learn in the middle of ~30k lines).

This leads to my first, very beginner, question. I followed this how-to to generate a simple plane. But I don't understand why it's not lightened correctly, as the sphere is (from the Knight sample).

Here is the code that generate the plane:
Code:
   vec3f pos_data[] = {
      vec3f(0, 0, 0),
      vec3f(1, 0, 0),
      vec3f(0, 0, -1),
      vec3f(1, 0, -1)
   };

   uint index_data[] = {
      0, 1, 2,
      2, 1, 3
   };

   short normalData[] = {
    0, 1, 0,
    0, 1, 0,
    0, 1, 0,
    0, 1, 0
   };

   float uvData[] = {
    0, 0,
    1, 0,
    0, 1,
    1, 1
   };

   H3DRes geometry = h3dutCreateGeometryRes("geoRes", 4, 6, (float*)pos_data, index_data, normalData, 0, 0, uvData, 0);
   H3DNode chunk = h3dAddModelNode(parent, "DynGeoModelNode", geometry);
   H3DRes material = h3dAddResource(H3DResTypes::Material, "models/sphere/stones.material.xml", 0);

   h3dAddMeshNode(chunk, "DynGeoMesh", material, 0, 6, 0, 3);
   h3dutLoadResourcesFromDisk(".");

Bonus question: are the data copied by the engine ?

And here is what the program produces:
Attachment:
Screen Shot 2011-12-21 at 12.30.51 PM.png
Screen Shot 2011-12-21 at 12.30.51 PM.png [ 32.73 KiB | Viewed 9091 times ]


Thanks in advance :)


Top
 Profile  
Reply with quote  
PostPosted: 21.12.2011, 10:12 
Offline

Joined: 21.12.2011, 01:10
Posts: 15
Just a shot in the dark here.

You are creating a quad that is textured on side. I know it's probably obvious, but have you tried... Looking on the other side? I am not 100% sure, but since you chose negative z-Indexes for your pos_data, your index_data may have to be reversed to work as well.

If that doesnt work, try a different material that doesn't use an advanced shader. What your bitplane might be missing is a tangent/bitangent vector per vertex in order to render some advanced material using bump mapping or something similar. Alternatively, just add those vectors in in your call for h3dutCreateGeometryRes() (in your case those arrays are similar to the normalData and should be pointing into x and z directions respectively).

Also check the .html log that horde generates. That should contain all real errors like missing ressources etc..


Top
 Profile  
Reply with quote  
PostPosted: 21.12.2011, 12:00 
Offline

Joined: 21.12.2011, 09:08
Posts: 3
That solved my lighting problem. Many thanks ! :)
About my documentation problem, do you have any advice for me ?


Top
 Profile  
Reply with quote  
PostPosted: 21.12.2011, 12:46 
Offline

Joined: 21.12.2011, 01:10
Posts: 15
Horde3D should probably be ideal for your original task. To learn how Horde3D truly works, I would suggest to analyze all the stuff going on in the Utility library (functions starting with "h3dut"). From there you can see how vertex buffers etc. are passed to the engine and how the parsing of the .xml ressources is handled. That could actually be pretty interesting.

As for documentation, sadly there is very little. The engine itself is pretty straightforward (the Utility lib obfuscates this) and I got my way around with the documentation and trial/error alone. However, since the engine is a product of a university and there are regular projects by students that use it, maybe they have done some more work on your specific task when designing and expanding the engine. While I am not sure who to talk to for this, I guess they are reading this forum and may even jump to your aide.

@Admins: Please seriously consider opening up the Wiki for anonymous editing (there are reliable wiki tricks to block casino/viagra spam). Sometimes I have some useable code that could probably help others, but I really don't want to create an account or login for that. That is often all that is keeping me from sharing Horde3D related material. Also encourage the university of Augsburg students to publish snippets of their awesome games into the wiki for extra credit or something. ;)


Top
 Profile  
Reply with quote  
PostPosted: 21.12.2011, 17:01 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
rand wrote:
@Admins: Please seriously consider opening up the Wiki for anonymous editing (there are reliable wiki tricks to block casino/viagra spam). Sometimes I have some useable code that could probably help others, but I really don't want to create an account or login for that. That is often all that is keeping me from sharing Horde3D related material. Also encourage the university of Augsburg students to publish snippets of their awesome games into the wiki for extra credit or something. ;)

The wiki uses the same account as the forum, so there is no need to register again if you already post on the forums.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group