Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how to make a cartoon turn his head????????
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
appling




PostPosted: Mon Nov 10, 2003 9:50 pm   Post subject: how to make a cartoon turn his head????????

how to make a cartoon turn his head, just like he is seeing right side and left side,and looking for something. how to make this. Question Question
Sponsor
Sponsor
Sponsor
sponsor
Chimaera




PostPosted: Mon Nov 10, 2003 10:18 pm   Post subject: (No subject)

Do you mean making a picture that you're loading from a location or are you drawing this picture on the go? If you're drawing it on the go, then you'll have to set it for a for loop and change the coordinates of the circles/ovals/box/shape as the loop is executed so the location of the shape is changed.

I've devised a bit of a cheating method for making pictures look they're actually changing on the go but in reality, you're just loading up new pictures that have been modified slightly. What you do is draw 1 original picture that is going to be the original first slide shown and then the slides progressively change frame by frame, and you Pic.ScreenLoad (file.jpg) and then delay it by like (100) so it looks like it's being redrawn.

My 2nd method is faster to do because you just have to open up mspaint and save like 50 slightly modified frames. The first one would probably impress your teacher more. I've seen a friend do a ball spinning around once and it was pretty slick. All you have to do is just draw the circle, and relocate the eyes/mouth/nose/ears etc. etc.

Dance
appling




PostPosted: Mon Nov 10, 2003 10:27 pm   Post subject: (No subject)

not pictures, it's the Graphics. i draw a cartoon head using turing. now i don't know how to make it turn his head like a cartoon.
code:
procedure guy
var x,y:int
x:=300
y:=x
%big face
drawfillarc(x,y,80,130,180,360,12)
drawfillarc(x,y,80,30,0,180,12)
%small face
drawfillarc(x,(y-15),65,100,170,370,14)
drawfillarc(x,(y+6),65,20,195,345,14)
%eyes
drawfilloval((x-30),(y-40),5,7,7)
drawfilloval((x+30),(y-40),5,7,7)
%noes
drawline(300,250,300,240,7)
%mouth
drawarc(x,(y-80),40,20,180,360,7)
end guy

guy


i need his head turn right,left,up,and down.
thoughtful




PostPosted: Mon Nov 10, 2003 10:34 pm   Post subject: (No subject)

basically then you need 5 pictures or graphics in total.
which will be
1. up
2.down
3.center
4.right
5.left

right and left are easy to draw as they can jus be flipped around.
First of all you have to draw these grpahics. you got the center made already, so make the other 4.
Then if you want to make it move the head from right to left you do something like
draw the right
delay(100)
cls
draw the center
delay(100)
cls
draw the left
delay (100)
cls

but you need to make those graphics your self. I would recommend a paint program, which would be much faster to draw the image. then you can load then into turing.
appling




PostPosted: Mon Nov 10, 2003 10:43 pm   Post subject: (No subject)

i try that,
but the picture1 turn to the picture2 is always flashing, it's not smooth, is there a better way?
Chimaera




PostPosted: Mon Nov 10, 2003 10:51 pm   Post subject: (No subject)

set the delay for a little longer so then there is less flashing and also try to have the colours fairly uniform so the change between frames is smoother and don't CLS, just redraw over it if it's the same size pictures
Tony




PostPosted: Mon Nov 10, 2003 11:03 pm   Post subject: (No subject)

set your view to
code:

View.Set("offscreenonly")


and use
code:

View.Update


after drawing the whole frame. It eliminated the flicker
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
appling




PostPosted: Tue Nov 11, 2003 4:16 pm   Post subject: (No subject)

thanks but how to use and where to use View.Set("offscreenonly") and View.Update
Sponsor
Sponsor
Sponsor
sponsor
thoughtful




PostPosted: Tue Nov 11, 2003 5:37 pm   Post subject: (No subject)

View.Set("offscreenonly") goes before you draw n e thing to screen.
View.Update is used to update the screen so put it before or after the cls
command
appling




PostPosted: Tue Nov 11, 2003 5:51 pm   Post subject: (No subject)

thanks now i get it
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: