Need Help Sprite and Image Size not the same

Blitz3D Forums/Blitz3D Beginners Area/Need Help Sprite and Image Size not the same

Blacky(Posted 2007) [#1]
How can i acces that the "Sprite" has the same size as the "Image" in 3 D.

It makes me crazy have tried "resize" and cant handle it. Pls help

thx



Graphics3D 800,600,16

cam = CreateCamera()
CameraRange cam,1,1000

MoveEntity cam,0,0,-10

sp = CreateSprite()
tex = CreateTexture(56,84)
SetBuffer TextureBuffer( tex )

; Clear texture buffer with background white color
ClsColor 255,255,255
Cls
EntityTexture sp,tex
SetBuffer BackBuffer()


;



Img=CreateImage(56,84)
SetBuffer ImageBuffer(img)
ClsColor 255,255,255
Cls
SetBuffer BackBuffer()

While KeyHit(1)<>True

If KeyDown( 205 )=True Then TurnEntity cam,0,-1,0
If KeyDown( 203 )=True Then TurnEntity cam,0,1,0
If KeyDown( 208 )=True Then MoveEntity cam,0,0,-0.1
If KeyDown( 200 )=True Then MoveEntity cam,0,0,0.1


UpdateWorld
WireFrame 0
RenderWorld
DrawImage img,MouseX(),MouseY() ; Draw the image!
Flip

Wend

End


Matty(Posted 2007) [#2]
When you create a sprite it is of the size 2 blitz units x 2 blitz units extending from -1,-1 to +1,+1.

You can use scalesprite to resize the sprite.

Furthermore you should not use a texture of size 56,84 because most video cards like power of 2 sized textures (not necessarily square though). So you may be better off using a texture that is 64x128 or 64x64 or 128x128 for the image you wish to use.


jfk EO-11110(Posted 2007) [#3]
I would also suggest to use one of the already existing and free Sprite-based pseudo-2D solutions that are floating around frequently, example given:
http://homepage.ntlworld.com/config/spritecontrol/spritecontrol.htm


Dreamora(Posted 2007) [#4]
or Draw3D