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

Username:   Password: 
 RegisterRegister   
 program/immage effects in turing...(scratch effect mainly)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
vertozia




PostPosted: Fri Jan 19, 2007 2:30 pm   Post subject: program/immage effects in turing...(scratch effect mainly)

Having a look at this picture...
Posted Image, might have been reduced in size. Click Image to view fullscreen.


and this one.....
Posted Image, might have been reduced in size. Click Image to view fullscreen.


I wanted to create this effect in turing using a .gif picture format, but since the format is not supported in turing i cannot, so i will have to create it usingturing, i was thinking of using Draw.Line in turing, but it will take too many lines and too much time. If i can do this otherwise please tell me. Thanks in advance.
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Fri Jan 19, 2007 4:09 pm   Post subject: Re: program/immage effects in turing...(scratch effect mainly)

of course it's possible to do, you just have to put some thought into it. You could use a series of .jpg's and create a class that could do this, drawing thick lines or random length and a variable thickness vertically. just think about it some more.
vertozia




PostPosted: Fri Jan 19, 2007 5:39 pm   Post subject: RE:program/immage effects in turing...(scratch effect mainly)

i thought of this, using bitmaps, about 3 of them, ,then use array to rotate through them, and use array to shift them so it has a vibrating effect. but there is an issue to this, the bitmaps will go over my other pictures and words.
Clayton




PostPosted: Fri Jan 19, 2007 5:45 pm   Post subject: Re: program/immage effects in turing...(scratch effect mainly)

could we see some code? my guess is that you draw the pictures after you output your text and such.
Tony




PostPosted: Fri Jan 19, 2007 7:03 pm   Post subject: RE:program/immage effects in turing...(scratch effect mainly)

It shouldn't take many lines of code, probably just a few.

Those "effects" are simply noise. Turing comes with a pre-build noise function
Turing:

Rand.Int(min,max)

You just have to adjust your min and max values to determine how far appart and how long the lines will be. Then iterate over it in a loop.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
vertozia




PostPosted: Fri Jan 19, 2007 11:04 pm   Post subject: RE:program/immage effects in turing...(scratch effect mainly)

i didn't really get the last post, but sure let me just finish (trying) and ill upload it as a zip or rar archive.
[Gandalf]




PostPosted: Sat Jan 20, 2007 2:14 pm   Post subject: RE:program/immage effects in turing...(scratch effect mainly)

Tony was talking about drawing something like this over your image:
Turing:
setscreen("graphics:400;400")
for i : 1 .. 100
    var x : int := Rand.Int (5, maxx - 5)
    var y : int := Rand.Int (5, maxy - 5)
    Draw.Line (x, y, x + Rand.Int (-30, 30), y + Rand.Int (-30, 30), black)
end for
vertozia




PostPosted: Sat Jan 20, 2007 4:37 pm   Post subject: Re: program/immage effects in turing...(scratch effect mainly)

Thanks for explaining, you guys have been really helpful to me. I played a little with the code you gave me and ended up with this

the following code:


code:
loop
for i : 1 .. 500
    var x : int := Rand.Int (5, maxx - 5)
    var y : int := Rand.Int (5, maxy - 5)
    var z : int := Rand.Int (10,maxy - 17)
    Draw.Line (x, z, x + Rand.Int (-8, 111), y + Rand.Int (-90, 111), white)
    Draw.Line (x, y, 444 + Rand.Int (-50, 777), 255 + Rand.Int (-20, 555), white)

    delay (90)
    cls
end for
end loop


I need to merge it with the math.t file, but everywhere i put it, it always overwrites the other images and files, i need to make it only run during the introduction screen, and the menu. Can you please help me?



math.zip
 Description:
the .t is in here with other picture files

Download
 Filename:  math.zip
 Filesize:  56.68 KB
 Downloaded:  89 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Bored




PostPosted: Mon Jan 22, 2007 4:47 pm   Post subject: Re: program/immage effects in turing...(scratch effect mainly)

very simply create a procedure to draw the random lines (i.e.)
Turing:
proc DrawLines
    for i : 1 .. 50
        var x : int := Rand.Int (5, maxx - 5)
        var y : int := Rand.Int (5, maxy - 5)
        var z : int := Rand.Int (10,maxy - 17)
        Draw.Line (x, z, x + Rand.Int (-8, 111), y + Rand.Int (-90, 111), white)
        Draw.Line (x, y, 444 + Rand.Int (-50, 777), 255 + Rand.Int (-20, 555), white)
    end for
end DrawLines

You then call this procedure everytime you need "random" lines drawn.
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  [ 9 Posts ]
Jump to:   


Style:  
Search: