Jump to content

May be a bug in CreateSurface ....


Icare
 Share

Recommended Posts

Hi

 

I'm thinking that I found a bug in object with multi surface...I found a temporary solution, but it's very strange, it looks like the surface doesn't reset after a create

 

In first time my code who created 2 plans and I assign 2 materials, but the second surface doesn't show correctly the material. And the screen shot

 

	_mesh = CreateMesh()

	surf = _mesh.AddSurface()
	surf.AddVertex([1.0, 1.0, -1.0], [0.0, 0.0, 0.0], [0.0, 0.0])
	surf.AddVertex([1.0, 1.0, 1.0], [0.0, 0.0, 0.0], [1.0, 0.0])
	surf.AddVertex([1.0, -1.0, 1.0], [0.0, 0.0, 0.0], [1.0, 1.0])
	surf.AddVertex([1.0, -1.0, -1.0], [0.0, 0.0, 0.0], [0.0, 1.0])
	surf.AddTriangle(0, 1, 2)
	surf.AddTriangle(0, 2, 3)
	mat = LoadMaterial("abstract::skyright.mat")
	PaintSurface surf, mat

	' Front Face
	surf = _mesh.AddSurface()
	surf.AddVertex([1.0, 1.0, -1.0], [0.0, 0.0, 1.0], [1.0, 0.0])
	surf.AddVertex([1.0, -1.0, -1.0], [0.0, 0.0, 1.0], [1.0, 1.0])
	surf.AddVertex([- 1.0, -1.0, -1.0], [0.0, 0.0, 1.0], [0.0, 1.0])
	surf.AddTriangle(0, 1, 2)
	surf.AddTriangle(0, 2, 3)
	mat = LoadMaterial("abstract::test.mat")
	PaintSurface surf, mat

 

And the screen

surface01.jpg

 

the solution, I must Create two Time the First vertex on the second surface

 


	_mesh = CreateMesh()

	surf = _mesh.AddSurface()
	surf.AddVertex([1.0, 1.0, -1.0], [0.0, 0.0, 0.0], [0.0, 0.0])
	surf.AddVertex([1.0, 1.0, 1.0], [0.0, 0.0, 0.0], [1.0, 0.0])
	surf.AddVertex([1.0, -1.0, 1.0], [0.0, 0.0, 0.0], [1.0, 1.0])
	surf.AddVertex([1.0, -1.0, -1.0], [0.0, 0.0, 0.0], [0.0, 1.0])
	surf.AddTriangle(0, 1, 2)
	surf.AddTriangle(0, 2, 3)
	mat = LoadMaterial("abstract::skyright.mat")
	PaintSurface surf, mat

	' Front Face
	surf = _mesh.AddSurface()
	surf.AddVertex([- 1.0, 1.0, -1.0], [0.0, 0.0, 1.0], [0.0, 0.0])
	surf.AddVertex([- 1.0, 1.0, -1.0], [0.0, 0.0, 1.0], [0.0, 0.0])
	surf.AddVertex([1.0, 1.0, -1.0], [0.0, 0.0, 1.0], [1.0, 0.0])
	surf.AddVertex([1.0, -1.0, -1.0], [0.0, 0.0, 1.0], [1.0, 1.0])
	surf.AddVertex([- 1.0, -1.0, -1.0], [0.0, 0.0, 1.0], [0.0, 1.0])
	surf.AddTriangle(0, 2, 3)
	surf.AddTriangle(0, 3, 4)
	mat = LoadMaterial("abstract::test.mat")
	PaintSurface surf, mat

 

And the screen

surface02.jpg

 

Nicolas

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...