Page 2 of 3

Re: Advice needed before I begin a project

Posted: Fri Oct 04, 2013 3:23 am
by Seymour Clufley
Thanks, IV. Do you mean the points of each triangle, or the triangles themselves? I've been wondering whether it will matter which order the vertices are added to a mesh.

Re: Advice needed before I begin a project

Posted: Fri Oct 04, 2013 3:42 am
by IdeasVacuum
...The points of each triangle. I'd go for anti-clockwise, just incase it matters later.

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 05, 2013 5:28 pm
by Seymour Clufley
I'm making good progress with my project. Here is a screenshot:

Image

But, as you can see, there are no shadows and you can't tell the side of a building from the roof. I did add a light but that had no effect on the scene whatsoever.

Adding either of these lines:
WorldShadows(#PB_Shadow_Modulative)
WorldShadows(#PB_Shadow_Additive)
causes this immediate crash:
Image

Could this be related to the fact that I have no graphics card? I'm using the motherboard's onboard graphics. This seems like a ridiculous question but I have to ask, since everything has been working fine up till now.

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 05, 2013 6:17 pm
by Bananenfreak
I don“t think this will be a solution, but add for every Mesh

Code: Select all

BuildMeshShadowVolume()
.

http://www.ogre3d.org/forums/viewtopic.php?f=2&t=68371
There could also be a Problem with your selfbuild houses.

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 05, 2013 6:26 pm
by Samuel
Looks like your mesh lacks normals.

EDIT: You can use NormalizeMesh(#Mesh [, SubMesh]) to generate flat shading. Just make sure every face has its own 3 vertices.
If the face is sharing a vertex with a another the command won't work right. The reason is each vertex can only have one normal, but you can have many vertices at the same point each with a different normal. That will give you flat shading and for a building I believe that's what you want.

In order to get smooth shading like for a sphere. You have to calculate the average normal of the faces that are connected at a shared vertex. Then use MeshVertexNormal(x, y, z) to set the individual normal for that vertex.

I'm sorry If I confused you with all this gibberish. I'm not the best when it comes to explaining this stuff. I'm sure you can find some more info on vertex normals with a little searching.

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 05, 2013 6:31 pm
by Comtois
without a snipet, it's difficult to say why it crash, may be because you dont use index ?

http://www.forums.purebasic.com/english ... 36&t=56514


[EDIT]
I have tested your code, add this and it will not crash.

Code: Select all

MeshFace(vertex-2,vertex-1,vertex)

Re: Advice needed throughout my first 3D project

Posted: Sun Oct 06, 2013 11:56 am
by Seymour Clufley
Surprisingly enough, I solved this problem by installing DirectX 9. I already had v11 installed but it seems that PB, or Ogre, relies on v9.

Re: Advice needed throughout my first 3D project

Posted: Sun Oct 06, 2013 1:37 pm
by IdeasVacuum
....Try also Compiler Options/Library Subsystem: OpenGL
DX9c is the highest supported by Windows XP, so maybe that's an Ogre thing. OpenGL on the other hand works with most OS.

Re: Advice needed throughout my first 3D project

Posted: Sun Oct 06, 2013 4:19 pm
by Bananenfreak
DirectX 11 is not an update of dx10 and dx10 is NOT an update of dx9.
These 3 DirectX are not the same and should be all installed (min. Win Vista)

Re: Advice needed throughout my first 3D project

Posted: Wed Oct 23, 2013 1:32 am
by IdeasVacuum
How is your project going Seymour?

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 26, 2013 9:09 pm
by Seymour Clufley
Thanks for asking, IV. I'm sorry to tell you that I've had to abandon the project for now. There are just too many things on my plate and this one isn't top priority. My aim was to put the triangulation and other code into Tips & Tricks, as separate code-bases, and I will still do that if I ever return to the project and finish it.

Re: Advice needed throughout my first 3D project

Posted: Sat Oct 26, 2013 10:12 pm
by IdeasVacuum
Well, being busy is a very good thing :)