Sswift EntityScale functions

Blitz3D Forums/Blitz3D Programming/Sswift EntityScale functions

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have been trying to use the EntityScale functions from the code archives . The effect I am after is a separate image of specific entities, however the entities vary in size and scale a lot.

The problem I have is that the functions only refer to the Original scale of the meshes, not the scaled-up/down versions I need in my game.

Is there any way around this? All I need is to move the camera far enough away so that the meshes fit in the camera viewport.

here's my code:

	Vx# = GetMatElement(targetEntity, 0, 0)
	Vy# = GetMatElement(targetEntity, 0, 1)
	Vz# = GetMatElement(targetEntity, 0, 2)	
	
	ScaleX# = Sqr(Vx#*Vx# + Vy#*Vy# + Vz#*Vz#)

	Vx# = GetMatElement(targetEntity, 1, 0)
	Vy# = GetMatElement(targetEntity, 1, 1)
	Vz# = GetMatElement(targetEntity, 1, 2)	
	
	ScaleY# = Sqr(Vx#*Vx# + Vy#*Vy# + Vz#*Vz#)

	Vx# = GetMatElement(targetEntity, 2, 0)
	Vy# = GetMatElement(targetEntity, 2, 1)
	Vz# = GetMatElement(targetEntity, 2, 2)		
	ScaleZ# = Sqr(Vx#*Vx# + Vy#*Vy# + Vz#*Vz#)


PositionEntity target,EntityX#(targetentity,1),EntityY#(targetentity,1),EntityZ#(targetentity,1)

TranslateEntity target,0,0,((scaleX#+ScaleY#+ScaleZ)/3)

PointEntity target,targetentity



Where target = camera
and targetentity = mesh