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

Username:   Password: 
 RegisterRegister   
 A revolving car...
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DonQuixote




PostPosted: Thu May 27, 2004 4:01 pm   Post subject: A revolving car...

Hi !!
I am a REAL newbie to Turing, so bear with me if I am a bit ignorant... Very Happy
Anyways, I need help on displaying a car that initially viewed from the side and gradually revolves to reveal its front... then it revolves to the same direction to reveal its other side... and so on until it returns to its initial position... (if that didn't make sense then visit link)I know that I am going to need about 36 pictures for every 10 degrees and I do have all of the images but how would the code look like??
I have tried soo many things but none have worked... plz help me!!
THANX A BILLION!!!
Sponsor
Sponsor
Sponsor
sponsor
DonQuixote




PostPosted: Thu May 27, 2004 4:02 pm   Post subject: (No subject)

O yeah when the site comes up... press on the "360 view"... You'll see what I mean 8)
guruguru




PostPosted: Thu May 27, 2004 4:23 pm   Post subject: (No subject)

You could do 3D... Catalyst's engine... or...

Rip off BMW and print screen every couple seconds to get 36 or so pictures. Pic.FileNew to make them a vairbale. Pic.Draw to draw them.
Cervantes




PostPosted: Thu May 27, 2004 5:56 pm   Post subject: (No subject)

he said he has the pictures.

code:

var pic1 := Pic.FileNew ("pic1.bmp")
var pic2 := Pic.FileNew ("pic2.bmp")
.
.
var pic36 := Pic.FileNew ("pic36.bmp")


var pic_counter : int := 1

loop
    cls
    Pic.Draw ("pic" + intstr (pic_counter) + ".bmp", x, y, picCopy)
    if pic_counter >= 36 then
        pic_counter := 1
     else
    pic_counter += 1
    end if
end loop


a bit of explaining of syntax in case you don't know already:
code:
var pic1 := Pic.FileNew ("pic1.bmp")

this is really:
code:
var pic1 : int := Pic.FileNew ("pic1.bmp")

turing automatically recognizes the variable as an int since it was initialized with Pic.FileNew.

next

code:
    pic_counter += 1

this is the same as
code:
    pic_counter := pic_counter + 1


hope this helps
-Cervantes
guruguru




PostPosted: Thu May 27, 2004 6:09 pm   Post subject: (No subject)

You forgot to add in the loop:

code:

if pic_counter + 1 > 36 then
    pic_counter := 1
else
    pic_counter += 1
end if


That just makes sure you dont try to acces a picture that doesnt exist.

Note: My bad I didnt read carfully enought that he had pictures.
DonQuixote




PostPosted: Thu May 27, 2004 8:21 pm   Post subject: (No subject)

Can I use .jpg format instead of .bmp?
This is because I used adobe photoshop to crop out the image...
guruguru




PostPosted: Thu May 27, 2004 8:22 pm   Post subject: (No subject)

Yes. Turing supports .jpg .bmp (and others?). It doesnt yet support .gif yet however.
DonQuixote




PostPosted: Thu May 27, 2004 9:09 pm   Post subject: (No subject)

Why does it constantly display an error message saying : "Argument is the wrong type"?
Sponsor
Sponsor
Sponsor
sponsor
guruguru




PostPosted: Thu May 27, 2004 9:18 pm   Post subject: (No subject)

A picutre is an integer (int). What are you making it? I can't even tell if pictures are what is causing the error... so what is causing it?
DonQuixote




PostPosted: Thu May 27, 2004 9:29 pm   Post subject: (No subject)

code:

loop
    cls
    Pic.Draw ("pic" + intstr (picCounter) + [b]".bmp"[/b], X, Y, picCopy)
    if picCounter >= 36 then
        pic_counter := 1
    else
        picCounter += 1
    end if
end loop

The bolded section keeps being highlighted and displays the error message... have no idea why... here, i ll put up my code
code:

const X := maxx div 2 - 50
const Y := maxy div 2 - 50
var picCounter : int := 1
var pic1 := Pic.FileNew ("pic1.bmp")
var pic2 := Pic.FileNew ("pic2.bmp")
var pic3 := Pic.FileNew ("pic3.bmp")
var pic4 := Pic.FileNew ("pic4.bmp")
var pic5 := Pic.FileNew ("pic5.bmp")
var pic6 := Pic.FileNew ("pic6.bmp")
var pic7 := Pic.FileNew ("pic7.bmp")
var pic8 := Pic.FileNew ("pic8.bmp")
var pic9 := Pic.FileNew ("pic9.bmp")
var pic10 := Pic.FileNew ("pic10.bmp")
%------------------------------------------------------

loop
    cls
    Pic.Draw ("pic" + intstr (picCounter) + ".bmp", X, Y, picCopy)
    if picCounter >= 36 then
        pic_counter := 1
    else
        picCounter += 1
    end if
end loop

Plz just trace through and tell me what is wrong ... Thanx
DonQuixote




PostPosted: Thu May 27, 2004 9:35 pm   Post subject: (No subject)

Some mistakes...
code:

    if picCounter >= 36 then

should be
code:

    if picCounter >= 10 then


and

code:

        picCounter := 1

should be
code:

        picCounter := 1



Sorry i amm really lame...
guruguru




PostPosted: Thu May 27, 2004 9:48 pm   Post subject: (No subject)

Lol whatever, it s'all good. We all make mistakes some time or another. Finding the mistakes and knowing how to correct them is what makes a good progrmmer.
DonQuixote




PostPosted: Fri May 28, 2004 6:07 am   Post subject: (No subject)

Is there a problem though??
Plz just keep in mind : I am a newbie Laughing lol
I really can't think of a solution... plz help.. THANX!!!
guruguru




PostPosted: Fri May 28, 2004 3:19 pm   Post subject: (No subject)

Ah yes! I just notices it after being ver puzzled. Pic.Draw() takes a variable as the first paramater. You are giving it a string. What you want to do is use Pic.ScreenLoad(), white takes a string for the first paramater. Then, you don't even need to declare the pics.

code:

const X := maxx div 2 - 50
const Y := maxy div 2 - 50
var picCounter : int := 1

%------------------------------------------------------

loop
    cls
    Pic.ScreenLoad ("pic" + intstr (picCounter) + ".bmp", X, Y, picCopy)
    if picCounter >= 10 then
        picCounter := 1
    else
        picCounter += 1
    end if
end loop
DonQuixote




PostPosted: Fri May 28, 2004 3:45 pm   Post subject: (No subject)

Thank you sooooo very much!
I really appreciate your help!!!! Thanx guruguru and Cervantes!!!
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 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: