Is there a way to import a wireframe model in unity? Is there a way to convert a wireframe model in an array can be used with gl.lines? I try with vectrosity, but line maker support only object with few mesh number. If I convert a mesh into each line (before import) I could use line renderer?
The easiest solution is to bake your uv's into a texture map, then change the transparency of all areas there isn't a line to 0. Then when you apply the texture to your mesh, there will be a wireframe look to it.
I've never tried doing it with GL lines. I imagine that you could do it.
Here's an attempt to do it with GL lines:
I would say Vectrosity. You don't have to use the LineMaker tool; that's just a way to create the array of points manually where you have complete control over the results. You can create the array of points some other way using a script. Exactly how, I'm not entirely sure, but it would probably involve parsing a raw object file yourself with the quads intactnot processed by Unity, which always converts to trianglesprobably .obj, which is fairly simple. The line renderer gives quite poor results as a wireframe renderer (which is one reason Vectrosity exists).
I already tried with texture baking but the effect is no good. The wireframe line is not define. I tried with the wireframe script (that use Gl.line) and it work great, but the problem is that displays all lines, including diagonal and I have no control over the lines. I think I have two options. 1) Convert each line (in 3ds) in a mesh and use line renderer to display it as a line, but I do not know how to use line rendered 2) Find a script or software or otherthing for convert a wireframe model in an array of points you can put in a script.
Any idea?
Ok. I think I'm in the right way. I modified Linemaker for use it with object that have more than 5000 vertices. Little slow but work. I try some script to convert obj model into array. Will is not easy. I try to wright a script to draw wireframe from array, but give me error... Somebody help me?
This is the script:
static var lineMaterial : Material; var LineColor : Color; var Linearray : []; //unity give me error in this line
function Start (){ var Linearray : new Array (Vector3(0, 0, 0), Vector3(0, 10, 0)); //array with two point, only for example }
static function CreateLineMaterial() { if( !lineMaterial ) { lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" + "SubShader { Pass { " + " Blend SrcAlpha OneMinusSrcAlpha " + " ZWrite Off Cull Off Fog { Mode Off } " + " BindChannels {" + " Bind \"vertex\", vertex Bind \"color\", color }" + "} } }" ); lineMaterial.hideFlags = HideFlags.HideAndDontSave; lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave; }
}
function OnPostRender() { CreateLineMaterial(); // set the current material lineMaterial.SetPass( 0 ); GL.PushMatrix(); GL.Begin( GL.LINES ); GL.Color(LineColor);
for (i = 0; i
{ GL.Vertex(Linearray*);* *}* *GL.End();* *GL.PopMatrix();* *}
*