COPYENTITY b3d animmesh strange behaviour?

Blitz3D Forums/Blitz3D Programming/COPYENTITY b3d animmesh strange behaviour?

FlagDKT(Posted 2006) [#1]
Copyentity a B3d loadedanimmesh works strange, or maybe there's something I dunno.
Those meshes are made by 2 texture, one of them Alphaed.
When duplicating those meshes, only the last looks right. The firsts don't display Alphaed textures...
Tried with other b3d models too...

Include "B3dExtensions.bb"

Global displaywidth=640
Global displayheight=480

Graphics3D displaywidth,displayheight,32,0
SetBuffer BackBuffer()
WBuffer=True

HidePointer()

Global cpos#=-6
Global filemesh$=("castagnola.b3d")

Function SmoothTurn(Entity,entity2,entity3)
	gMXSpeed = gMXSpeed*.9 - MouseXSpeed()*.12
	gMYSpeed = gMYSpeed*.9 + MouseYSpeed()*.12
	AX# = EntityPitch(Entity)
	AY# = EntityYaw(Entity)
	AX = AX + gMYSpeed
	AY = AY + gMXSpeed
	RotateEntity Entity, AX, AY, 0
	RotateEntity Entity2, AX, AY, 0
	RotateEntity Entity3, AX, AY, 0
	MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
End Function

; CAMERA INIT------------------------------------------------------------
	camera=CreateCamera()
	PositionEntity camera,0,0,-6
	CameraProjMode camera,1
	CameraClsColor camera,180,180,180
; -----------------------------------------------------------------------

	light=CreateLight()

	mesh=LoadAnimMesh (filemesh)
	mesh1=(CopyEntity (mesh))	MoveEntity(mesh1),1,0,0
	mesh2=(CopyEntity (mesh))	MoveEntity(mesh2),2,0,0

frameTimer = CreateTimer(30)
; MAIN LOOP -------------------------------------------------------------
While Not KeyHit(1)
WaitTimer(frameTimer)

	PositionEntity camera,0,0,cpos
	PointEntity camera,mesh1
	PointEntity light,mesh
		
	smoothturn(mesh,mesh1,mesh2)
	Select MouseZSpeed ()
	Case -1
	cpos=cpos-0.5
	Case 1
	cpos=cpos+0.5
	End Select

	UpdateWorld()
	RenderWorld()
	Text 0,0,"Mousewheel to zoom"
Flip
Wend
End



Code+Models ** HERE **


MadJack(Posted 2006) [#2]
FlagDKT

I downloaded your code snippet and got the same result - the fish copy's tails are not drawn.

I came up against something similar a little while ago
http://www.blitzbasic.com/Community/posts.php?topic=62009

I was copying a single surface animated B3d that had been set to additive blend (outside of blitz). In that case the copies would often not be drawn or drawn only intermittantly.

D-Grafix mentioned that TED goes through and sets the blend mode for each surface manually (on an imported mesh before making instances).

Seems to me though, that that shouldn't be necessary.


kevin8084(Posted 2006) [#3]
CopyMesh works though...hmmm


Pinete(Posted 2006) [#4]
Hi,
I also had some strange problems with copyentity..
so, here is the link to see what some guys of forum
answered me... maybe it could be helpful for you... :)

http://www.blitzbasic.com/Community/posts.php?topic=60523#675392

regards!,


FlagDKT(Posted 2006) [#5]
I just can't understand why the last copiedentity works correctly...
eg:if I make 20 copies, then the 20th will work.

Ah...If I change those textures to MASKED it works. It's only an alphablend matter.


slenkar(Posted 2006) [#6]
also copied animmesh's can connect to each other sometimes,

these issues need to be looked at


MadJack(Posted 2006) [#7]
'these issues need to be looked at '

Agree - given that using copyentity is the way to keep surface count down.