Computer Science Canada

3D module

Author:  Nick [ Fri Aug 24, 2007 8:15 am ]
Post subject:  3D module

i have crated a 3-d module based on windsurfer's tuturial here

the module features picCopy and picMerge atm but you can edit the module yourself... also the if z> 0 stops the program from crashing if z is less than 1 so please do not take that out..

here is the code

Turing:
unit

module Draw3D

    export all

    procedure PicMer (PicID : int, x, y, z : int)
        if z > 0 then
            var newPic : int
            newPic := Pic.Scale (PicID, z, z)
            Pic.Draw (newPic, x, y, picMerge)
            Pic.Free (newPic)
        end if
    end PicMer

    procedure PicCop (PicID : int, x, y, z : int)
        if z > 0 then
            var newPic : int
            newPic := Pic.Scale (PicID, z, z)
            Pic.Draw (newPic, x, y, picCopy)
            Pic.Free (newPic)
        end if
    end PicCop

end Draw3D


enjoy

(edit) i realize some people do not know how to import so here it is...

copy and paste the syntax above into a turing file and save it wherever but remember the location

(ex. your desktop)

open a new file and in the first line of coding put "import ("the file's location")

once more... enjoy

edit: once more ive realized something

to use the module just put "Draw3D.pic[Mer/Cop] with the appropreate params

Author:  CodeMonkey2000 [ Fri Aug 24, 2007 5:06 pm ]
Post subject:  RE:3D module

You aren't scaling the pictures properly. Nor are you drawing them at the right spot.

Author:  Nick [ Fri Aug 24, 2007 7:54 pm ]
Post subject:  RE:3D module

well that can all be changed depending on the x,y,and z inputted into the program and also if there are anything you would like to change the code is presented for you so please feel free to modify it in any way


: