Flipmesh

Blitz3D Forums/Blitz3D Programming/Flipmesh

Jerome Squalor(Posted 2007) [#1]
is flipmesh the same as scalemesh mesh,-1,-1,-1?


big10p(Posted 2007) [#2]
No


Jerome Squalor(Posted 2007) [#3]



when i replace the Scaleentity out,-1.1,-1.1,-1.1 with FlipMesh(out) the outline no longer shows.


Blitz3dCoder(Posted 2007) [#4]
I am probably way off track but,
Here is my thought, the default color of a mesh is white and you colored the copied mesh as black, then relocated it on the z axis, when you flipped it maybe the color was lost because it is now on the inside, and the inside is white.

Just out of curiosity what is this for?


Stevie G(Posted 2007) [#5]
Here is my thought, the default color of a mesh is white and you colored the copied mesh as black, then relocated it on the z axis, when you flipped it maybe the color was lost because it is now on the inside, and the inside is white.



Eh? Nonsense.


@ Kip, is this what you want?

out = CopyMesh(ball,ball)
EntityColor out,0,0,0
FlipMesh out
UpdateNormals out
ScaleMesh out, 1.1,1.1,1.1



JustLuke(Posted 2007) [#6]
He wants to create an outline for his models.

Unfortunaltely, uniformly scaling a mesh's "outline mesh" (using ScaleMesh) causes problems for anything other than simple geometric shapes such as cubes and spheres. What he needs to do is extrude each vertex of his duplicated, flipped mesh outwards by a set amount (which can be varied to alter the thickness of the lines.) He'll have to write a custom routine to do this or use modelling software.


puki(Posted 2007) [#7]
I think there is more than one example in the archives for giving meshes outlines.


JustLuke(Posted 2007) [#8]
Yup, but none of them are satisfactory solutions.


Stevie G(Posted 2007) [#9]
Like this ....

function MESHoutline( Source , Offset#= .1 )

   Outline = copymesh( Source, Source )
   flipMesh Outline
   updatenormals Outline
   entitycolor Outline,0,0,0
   
   for cs = 1 to countsurfaces( Outline )
      s = getsurface( Outline, cs )
      for v = 0 to countvertices( s ) - 1
          vertexcoords s, v, vertexx(s,v)+vertexnx(s,v ) * Offset , vertexy( s, v ) + vertexny( s, v ) * Offset , vertexz( s, v ) + vertexnz( s, v ) * offset
      next
   next

end function