• Welcome to Twisted DIRT Forums.
 

News:

MX vs ATV Reflex PC Multi-Player back on line 10/8/2013.  Get Racing.

Main Menu

Milkshape 3D problem

Started by XFR_Odin_1, March 10, 2005, 02:17:38 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

XFR_Odin_1

Laurie,

Been working with Milkshape and the plugin that you made (nice stuff, thanks for the work) but when I export a bail on 2 of the six sides the shadowing is on the wrong side of the bail.  All other surfaces reflect properly.  The sides in question are the left and right sides, front, back, top and bottom are all properly lighted.  Reversing vertex order gives the opposite problem, that is:  Left and right are fine, but the rest of the object lights backwards.

Any thoughts?


-Odin

mcm2boys

I'm not sure why that is, i'm not too sure what you mean by:

Quotewhen I export a bail on 2 of the six sides the shadowing is on the wrong side of the bail

You mean the texture is flipped left to right on those sides, or when you're in game the shadows from the sun are all wrong?

I'm guessing it's the texture. What you can do is reverse the vertex order of the faces in just the left and right sides - but this can have weird effects in game because you can only see faces in MCM2 from one side. Or you can use the texture mapper to change the texture mapping for the left and right sides - probably the best option once you have the faces all with the visible side facing out from the bail.

To do this: In the main window use 'Select' 'Vertices' and check the 'ignore backfaces' option - then you are only selecting the verts you can see in each view. Now select the verts for the side you are change the texture mapping for. Press ctrl-T to open the texture mapper. Now in the texture mapper you should see the texture as a background and the verts and their face you just selected. You can now use the button in the menu on the right to select and move groups of the verts until you get the mapping you want - so you need to jsut switch the position of the 2 verts on the left with the 2 verts on the right.

Something else that helps with how the object will look in game is to switch off the option 'Draw Backfaces' in each of the view ports, because this is how MCM2 renders objects. When you reverse the vertex order of a face it makes it visible only from the other side. This can sometimes make you think you have the textres the wrong way round but in fact you are just looking at it like you are inside the bail. If you spin the object in the 3D view port it is easier to see when some faces are inside out.

Hope that helps,
Laurie

XFR_Odin_1

I was actually asking about how the bail and the lighting react in game.  I made a couple of pics to help illustrate whats happening.





In each pic the light source is the same (90 direction and 45 pitch) and the bails are oriented with the long sides either perpendicular or parallel to the light source.  As you see the lighting on the short side of the bail is correct, but the long sides of the bail the lighting is reversed.  The lighting of the bail is normal in Milkshape and this is not because the bails are placed in that particular position.  A sigle bail will light the same way.  Hope this helps get my question across and if this effect is what you were answering just let me know to read your post a little more carefully.

-Odin

cR

Hmmm meybe you can pre-light it...

XFR_MJS

now thats a nice lookin bale  ;D

cR


XFR_Odin_1

Actually cR, thats about 80% of the size of a stock bail.  If you look in the background of pic 1 there is a stock bail at the top.  What they are is in-between the size of spodes small bails and a stock bail.

And thanks goes to XFR_MIS, thats his texture skin on those bails.


-Odin


mcm2boys

I'm guessing your bail texture has no lighting on it already - so all the sides are the same color?

Hmm, i just read your first post again, and i think this might have something to do with normals - looks like i am going to have to take another look at the plug-in to see if it's something i've done wrong or if there is something you need to do in Milkshape.

MCM2 probably uses the normals to work out the lighting, if the normals are facing the wrong way then the face will seem to the lighting calculations like it is on the wrong side of the light source, with results like you see.


Laurie

cR

Can't you 'weld' all vertex points? This works good in Max with this kind of problem.

mcm2boys

The direction of the normals is calculated according to the way the poly faces, but if the poly faced the wrong way it would be transparent, so i can only think i have something wrong in the exporter which is swapping the normals.

Odin you said you can change it by reversing the vert order (was that of the whole object or just a few polys?), can you just try reversing the vert order on the sides with the shadows that are wrong and see what that brings? How did you make the bail, did you use the ms3d box function or did you build from verts and joing them up into polys manually?

cR i'm not sure how you do that in Max or what that actually does to the model, so i can't say how you would do that in ms3d.


Laurie

cR

For example you have the top polygon and side polygon, they both have 4 vertex points right and 2 of each are on the same XYZ coordinates, when you weld them, well.. it welds them together, so instead of 8 vertex points you have 6... I hope that makes sence to you.. don't really know how to explain it... if ít doesn't make sence to you, I'll try and make a little vid of it :)

mcm2boys

hmm, not sure this will help since each vertex needs it's own normal otherwise the lighting will be wrong, which means that the points will be separated again when the object is exported.

Laurie

XFR_Odin_1

Laurie,

I used the ms3d box tool to make the bail.  I tried switching the order of certain vertices but this leads to those faces becoming transparent.  You explaination of the normals facing the wrong direction makes a lot of sense to me actually.  Your also right about the texture used, there is no lighting applied to it, all side are the same color.


-Odin

mcm2boys

I have found and fixed this bug. It was because I was reversing the X direction for the vertex positions but not the normals. It seems to work ok in the tests i carried out, and a new version of the Plug-in has been released.

Thanks for your feedback XFR_Odin_1.


Laurie

XFR_Odin_1

Got the latest version Laurie, I'll give it a run in the morning.  Thanks for making something us poor folk can use. 8)

-Odin

XFR_Odin_1

Ran it this morning and everything looks great.

-Odin

mcm2boys

Always good to have a second opinion, sometimes it only works for me. :)

Laurie

aaron.270

Is it possible to make animated objects with milkshape or is that something I would need to use max for.

mcm2boys

You can make animated objects with milkshape, a rider or bike model for instance. Or you could use Max. I think there might be some problems exporting animated models made from a single mesh, like a rider, in Max but i'm not sure of the details. I tried it a long while back and knowledge of Max and UniBastard havce improved since then.

Laurie