Flipmesh

Blitz3D Forums/Blitz3D Programming/Flipmesh

is flipmesh the same as scalemesh mesh,-1,-1,-1?

No

 Graphics3D 800,600,0,1
SetBuffer BackBuffer()



cam = CreateCamera()
	PositionEntity cam,0,0,-10
	RotateEntity cam,0,0,0
	CameraClsColor cam,255,255,255
	
lit = CreateLight()




pl = CreatePlane()
	EntityColor pl,100,100,100
	EntityPickMode pl,2








ball = Createsphere(100)
out = CopyMesh(ball,ball)
	EntityColor out,0,0,0
	ScaleEntity out,-1.1,-1.1,-1.1

While Not KeyHit(1)


If KeyDown(57) TurnEntity ball,1,1,1

UpdateWorld

RenderWorld


Flip


Wend

End



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

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?

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


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.

I think there is more than one example in the archives for giving meshes outlines.

Yup, but none of them are satisfactory solutions.

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