RotateImage Distorting
Blitz3D Forums/Blitz3D Beginners Area/RotateImage Distorting
| ||
I have a very simple rectangle I'm rotating, but it gets very distorted during rotation. The main problem is, the original non rotated image stays on top of the new ones and the new ones are all split and distorted.I don't know if this is a problem with my code, or something about the image but if anyone has any ideas, please help. |
| ||
Perhaps some sample code might let us help you further? |
| ||
Dim tur(45) RotateImage turr,-45 tur(0) = turr For i = 1 To 45 RotateImage turr,2 tur(i) = CopyImage(turr) Print i Next That's the image array initialization. Then, it just cycle's through as you hit the spacebar for testing. I would put a screenshot, but I don't know how. |
| ||
Blitz3d image manipulations are very horrid. If your going to do any 2d work, use Blitzplus or Blitzmax. Rotateimage is expected to return some artifacts. Or, you can put your image on a sprite and rotate the sprite. That will give you somewhat decent results. |
| ||
So, just load the image as a sprite? I didn't know Blitz3D was worse for 2D than the others. Well, that's OK, I'm planning on moving to 3D soon. That's what I got it for. |
| ||
It looks like you're repeatedly rotating an already-rotated image, which degrades the quality. Something like the below approach should help:Graphics 800,600 SetBuffer BackBuffer() original=LoadImage("YourImageGoesHere.jpg") turr = CopyImage(original) Dim tur(45) RotateImage turr,-45 tur(0) = turr For i = 1 To 45 Cls turr=CopyImage(original) RotateImage turr, -45 + 2*i tur(i) = CopyImage(turr) DrawImage tur(i),200,100 Print i Flip Next |
| ||
It looks WAY better now! Thanks! |