Advice needed throughout my first 3D project
-
Seymour Clufley
- Addict

- Posts: 1267
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: Advice needed before I begin a project
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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Advice needed before I begin a project
...The points of each triangle. I'd go for anti-clockwise, just incase it matters later.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
Seymour Clufley
- Addict

- Posts: 1267
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: Advice needed throughout my first 3D project
I'm making good progress with my project. Here is a screenshot:

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:

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.

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:
causes this immediate crash:WorldShadows(#PB_Shadow_Modulative)
WorldShadows(#PB_Shadow_Additive)

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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
- Bananenfreak
- Enthusiast

- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: Advice needed throughout my first 3D project
I don´t think this will be a solution, but add for every Mesh .
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=68371
There could also be a Problem with your selfbuild houses.
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
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.
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.
Last edited by Samuel on Sat Oct 05, 2013 6:42 pm, edited 2 times in total.
Re: Advice needed throughout my first 3D project
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.
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)Please correct my english
http://purebasic.developpez.com/
http://purebasic.developpez.com/
-
Seymour Clufley
- Addict

- Posts: 1267
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: Advice needed throughout my first 3D project
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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Advice needed throughout my first 3D project
....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.
DX9c is the highest supported by Windows XP, so maybe that's an Ogre thing. OpenGL on the other hand works with most OS.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- Bananenfreak
- Enthusiast

- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: Advice needed throughout my first 3D project
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)
These 3 DirectX are not the same and should be all installed (min. Win Vista)
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Advice needed throughout my first 3D project
How is your project going Seymour?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
Seymour Clufley
- Addict

- Posts: 1267
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: Advice needed throughout my first 3D project
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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Advice needed throughout my first 3D project
Well, being busy is a very good thing 
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.