I found a tutorial for rotating, and after only 2 weeks ( ) I understand almost all of it. Only problem is, there is this wierd thing going on that I just can't seem to figure out how to stop. The picture copys fine, but for some reason in the background of the pic there is some wierd stuff.. Anyone got any ideas?
Last edited by bobthebobert; Feb 15th, 2004 at 08:51 PM.
Is it meant to do anything?? I get a blank Black screen .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Nope, still the same. I made the change of the project File looking in a DIR but when the program runs it just shows a blank (black) screen with the mouse visible
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
wooohooo, works now. Give me a min to see whats causing that.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Another problem I am noticing, is that every other time I run the program, a little splice off the top right of the ship is missing, yet, sometimes it isn't missing...
Another problem I'm noticeing is that even the pic that isn't rotated doesn't look like the Ship.bmp file. To sort this out I suggest using 32bit which fixes it slightly.
For the main problem it looks like your reading the picture wrong, it looks like your reading from memory that the picture isn't in.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
There is lot of code here on the forum that does this very fast. If you want to look at it just make a search. But you probably have to learn more to understand them, but thats not a bad thing is it...:P
Originally posted by bobthebobert Yay, I fixed it! Except now, it cuts off portions of the picture, but I think I can fix that just by making the picutre I use have more empty space..
Yeah you'll probably just need to make the rotated pic's surface slightley bigger. Mind I agree with NoteMe, I was going to suggest earlier that you can easily do rotation using Direct3D with DirectDraw.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Hmm, for some odd reason changing the var "dblRMax" from a double to a long, made it now work perfect. Wierd. Except it still looks like crap when you rotate an image inbetween 90,180,270, and 0. Would using your method make it more accurate Note, because the code seems basically the same other then for the hdc stuff.
When I did it before I started using Dx3D I had an if statement that said when the angle was 90, 180, 270 or 360 (0) it would not use the normal method and would do a kind of flip and mirror method which meant less processing and not a dodgy end result. The code that Note gave seems to work well but by the looks of it it doesn't seem to resize the destination to fit the whole rotated image in .
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
I think the problem is actually with my picture. I made it in mspaint, and it is quite small... To make it look better, should I make say a 1000x1000 image and then resize it down to 100x100 in my code?
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
No, a picture always looks best at the size it was created. Every resizing algorithms introduces problems, and only a lot of processing can reduce these problems, never eliminate them. Making things larger is more problematic, but making things smaller is hard enough.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
How about using the Direct3D way? Might mean learning how it all works if you've never used it before tho.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Public Sub RotateSurface(ByRef surfSource As DirectDrawSurface7, surfDestination As DirectDrawSurface7, lngAngle As Long, XDest As Long, Ydest As Long)
Dim ddsdOrigine As DDSURFACEDESC2, ddsdDestination As DDSURFACEDESC2
Dim iX As Long, iY As Long
Dim iXDest As Long, iYDest As Long
Dim rEmpty As RECT, rEmpty2 As RECT
Dim sngA As Single, SinA As Single, CosA As Single
Originally posted by bobthebobert Hmm, for some odd reason changing the var "dblRMax" from a double to a long, made it now work perfect. Wierd. Except it still looks like crap when you rotate an image inbetween 90,180,270, and 0. Would using your method make it more accurate Note, because the code seems basically the same other then for the hdc stuff.
So what was the thingy here then..no problem with this with this code....and I have never had any of the other problems you are talking about either...
BTW do you know that rotating in real time in DDraw is slow?? Much faster to do it at design time, and then use a sprite with all the images to Blt to the screen...
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
I am always wondering if I see a person like CorcnedBee reads a thread like this for so long...what do he do. Does he laugh, do he teach him self something, did he just click the link and went for a walk....hmmmm
Originally posted by NoteMe I am always wondering if I see a person like CorcnedBee reads a thread like this for so long...what do he do. Does he laugh, do he teach him self something, did he just click the link and went for a walk....hmmmm
I think he's just putting a post in there to get the notifications, he hasn't found the "Subscribe to this Thread" link yet .
Originally posted by NoteMe and no. No D3D today Electro...
.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Was I looking at it for a long time? Do you mean, in one go or repeatedly for some time?
I check out such threads once in a while to see if some theoretical question comes up where I can avoid VB while helping out, promoting C++ at the same time
And in the meantime, I pity all ye people who use VB and know not better, and loathe al ye people who use VB and think there is no better.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
You where looking in it for a long time....so I was just thinking loud. There is a lot of persons that are not that serious about programming. And I have no problems about them programming in VB. I have done it in 7 years my self...and I don't want to put all of that on the shelf. I still think that using the right tool for the job is the right thing to do....
I gotta say I'm learning C++ and I'm finding it a lot more interesting, theres millions ways more of making things go wrong . I can see its better in a lot of ways but I too don't want to just thro VB away, its still useful for simple windowed apps.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
Yeah like map editors......but I have become much more aware of how I use variables, classes, functions, parameters and so on after I started C++, so I guess it has to be a good thing. Even ASM have thought me a great deal here...not to forget Java. Even if I don't like JAva...
hehe, all my lectures slag off Java so I'm not even going to bother. C++ is gonna be the lingo for me soon. I get to program on GameCubes sometime just after September and that'll be in C++ I'm told.
When your thread has been resolved please edit the original post in the thread ()
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.