gametechmods
Robot Arena => General Support => Topic started by: WhamettNuht on March 22, 2013, 02:13:06 PM
-
Hey :)
Sorry to have to post soo many threads haha xD
I'm having a slight problem with my Dantomkia shell mesh-
It keeps falling through the floor...
(https://gametechmods.com/uploads/images/30023dtk1.jpg)
(First image)
The collision shows that it's a solid object (2nd image)
Anyone know how to fix this problem?
Also, while i'm here, anyone know why it gets darker when it gets to that kind of angle? (3rd image)
If anyone wants to have a look at it then feel free :P
Also I know there's some face mesh problems (why the top doesn't show up) but i'm trying to sort one problem out at a time at the moment haha xD
https://gametechmods.com/uploads/files/dantomkia2.rar (https://gametechmods.com/uploads/files/dantomkia2.rar)
Thanks guys :)
-Wham
-
I can replicate this problem with a 90 degree axle and an EMERGENCY wedge. I believe if an object starts in the ground unexpectedly it defaults as being able to pass through it. (Or not colliding with anything, I haven't tested the effects of this for a while)
Haven't done GMF editing like that but perhaps you need to change the mesh's ambience HEX colour. Have a feeling it exists, just have a hunch.
-
Most the time this only occurs in the Test Arena it seems.
-
No it happens in all arenas :/ It's like the collision isn't even there - even the opponent robots pass through it :S It's showing that the collision is there, but it just doesn't seem to recognise it :/
-
Maybe you're using the wrong type of collision? IIRC there are like 3 or so types of collision, maybe someone more experienced can prove me wrong or something
-
Not too sure about that :S
It should be the same type as the ramplate collision :S
-
I haven't had enough time to find/fix all the errors yet but it has to do with the face normals.
-
Ahh ok :S Thank you for looking! :)
-
I corrected the face normals but some of them need to be flipped around still (by multiplying the three values after the index by -1). It seems to be going through the ground less now but if flipping some of the face normals doesn't completely fix your problem then you may need to modify the vertex normals. You can tell if the face normal needs to be flipped by the darkness of the skin when the light is pointed right at it (just rotate the component preview window until that side of your chassis lights up and if the component doesn't do the same then it is backwards). Here (https://gametechmods.com/uploads/files/dantomkia2_gmf_wip.zip) is the current version of the GMF (compiled and decompiled).
You had 133 faces in your mesh so there needed to be 133 face normals. You also needed to set them to be orthogonal to the face's surface (orthogonal is a term used in Calc III to describe a vector that is perpendicular to a surface in 3D space). For those of you who haven't taken Calc III, calculating the face normal is actually a relatively simple task. It goes something like this:
#Each face is made up of three points in space. We'll refer to these as A, B, and C.
#Each point in space has an x, y, and z value respectively. We'll tag the x, y, and z onto the point to specify which one we are referring to. For example, the x coordinate of A is Ax.
# Get the vectors for two edges (we'll use the lines from A to B and B to C)
Px = Ax-Bx
Py = Ay-By
Pz = Az-Bz
Qx = Bx-Cx
Qy = By-Cy
Qz = Bz-Cz
# Compute cross product of vector P and Q
Nx = Py*Qz - Pz*Qy
Ny = Pz*Qx - Px*Qz
Nz = Px*Qy - Py*Qx
Vertex normals can be calculated by taking the average of all the faces joined by each vertex. They are currently using the same as the face vector that they are associated with. It isn't always necessary to calculate these so I didn't do them (it is important that the face normals are correct before attempting to calculate these).
On a side note, I noticed that you set the passthru property inside of the Component.txt to "collision" but that is not an object within the Component.gmf. You probably want to set it to "ramplate" (the name of your current mesh).
Edit: As you may have already guessed, your lighting issue is related to the normals as well.
-
Thanks Trov, however it still doesnt appear to be working :/
Just had a slight idea - the way I meshed it was by mainly putting planes together, and IIRC, if a mesh is too thin, it seems to fall through the floor. It wouldnt be a problem like that would it? :S