Spinning "Party Tent" or Halo ring and Somewhat 3D
Author |
Message |
The_Bean
|
Posted: Sat Dec 08, 2007 12:13 am Post subject: Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
A Spinning thing using math and trig.
I know its not commented so if you understand it great
I didn't put a menu in it at the start, but i put all the variable at the top that you can play around with, and if you know what you are doing theres some other cool stuff inside you can mess around with.
And for my teacher i made it as fool proof as possilble.
Enjoy
Turing: |
% Name: Proclaimed Which by class mates
% Date: 07-12-07
% Program: Party Tent
% Purpose: To beet V****** "T" Third the Fifth
setscreen ("graphics:max,max,title:Party Tent,nobuttonbar")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%Only Change These%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var speed : int := 1 %The Speed at which the it rotates 1 works best unless your computer is slow
var numSides : int := 60 %The number of sides the shape has 60 looks best |>0, <120|
var dly : int := 0 %The delay should be 0 unless your computer is way to fast and the speed is already 1
var sidesShown : int := 1 %this is by whith the amount of sides that are being shown
%(1 shows all, 2 shows every other one , 3 shows every third one...)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%Unless You Know What Your Doing%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var colourScheme : string
var colourSkeem : int
var colourMax, colourMin : int
loop
put "Please eneter a colour scheme (1-4): " ..
get colourScheme
if strintok (colourScheme ) then
colourSkeem := strint (colourScheme )
if colourSkeem = 1 then
colourMax := 56
colourMin := 32
exit
elsif colourSkeem = 2 then
colourMax := 128
colourMin := 104
exit
elsif colourSkeem = 3 then
colourMax := 32
colourMin := 16
exit
elsif colourSkeem = 4 then
colourMax := 104
colourMin := 80
exit
else
put "Invalid Entry"
end if
else
put "Invalid Entry"
end if
end loop
setscreen ("offscreenonly")
type point :
record
degree : real
x : int
y1 : int
y2 : int
colou : int
end record
Text.ColourBack (7)
var colours : int := colourMin
var points : array 1 .. numSides of point
var radx, rady : int
var coneX, coneY : array 1 .. 3 of int
var cylinderX, cylinderY : array 1 .. 4 of int
var xm, ym, bm : int
coneX (3) := maxx div 2
coneY (3) := maxy div 6 * 5
for i : 1 .. upper (points )
points (i ).degree := 360 / upper (points ) * i
points (i ).colou := colours
colours + = 1
if colours = colourMax then
colours := colourMin
end if
end for
loop
Mouse.Where (xm, ym, bm )
radx := xm div 2 - maxx div 4
rady := ym div 2 - maxy div 3
colours := colourMin
for i : 1 .. upper (points )
points (i ).x := round (cosd (points (i ).degree ) * radx ) + maxx div 2
points (i ).y1 := round (sind (points (i ).degree ) * rady ) + maxy div 2 - maxy div 10
points (i ).y2 := round (sind (points (i ).degree ) * rady ) + maxy div 2 + maxy div 10
points (i ).degree - = speed
if points (i ).degree <= 0 then
points (i ).degree := 360
end if
points (i ).colou := colours
colours + = 1
if colours = colourMax then
colours := colourMin
end if
if colourSkeem = 1 or colourSkeem = 4 then
if points (i ).degree < 180 then
points (i ).colou + = 72
end if
end if
end for
cls
for k : 0 .. 360
for i : 1 .. upper (points ) by sidesShown
if points (i ).degree = k then
if i = 1 then
cylinderX (1) := points (i ).x
cylinderY (1) := points (i ).y1
cylinderX (2) := points (i ).x
cylinderY (2) := points (i ).y2
cylinderX (3) := points (upper (points )).x
cylinderY (3) := points (upper (points )).y2
cylinderX (4) := points (upper (points )).x
cylinderY (4) := points (upper (points )).y1
coneX (1) := points (i ).x
coneY (1) := points (i ).y2
coneX (2) := points (upper (points )).x
coneY (2) := points (upper (points )).y2
Draw.FillPolygon (cylinderX, cylinderY, 4, points (i ).colou )
Draw.Polygon (cylinderX, cylinderY, 4, 7)
Draw.FillPolygon (coneX, coneY, 3, points (i ).colou )
Draw.Polygon (coneX, coneY, 3, 7)
else
cylinderX (1) := points (i ).x
cylinderY (1) := points (i ).y1
cylinderX (2) := points (i ).x
cylinderY (2) := points (i ).y2
cylinderX (3) := points (i - 1).x
cylinderY (3) := points (i - 1).y2
cylinderX (4) := points (i - 1).x
cylinderY (4) := points (i - 1).y1
coneX (1) := points (i ).x
coneY (1) := points (i ).y2
coneX (2) := points (i - 1).x
coneY (2) := points (i - 1).y2
Draw.FillPolygon (cylinderX, cylinderY, 4, points (i ).colou )
Draw.Polygon (cylinderX, cylinderY, 4, 7)
Draw.FillPolygon (coneX, coneY, 3, points (i ).colou )
Draw.Polygon (coneX, coneY, 3, 7)
end if
end if
end for
end for
View.Update
delay (dly )
exit when hasch
end loop
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Sean
|
Posted: Sat Dec 08, 2007 9:09 am Post subject: Re: Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
I suggest you do some documentation on what actually happens, not just leaving newer people out in the blue.
A lot of people would like instructions mate. |
|
|
|
|
|
CodeMonkey2000
|
Posted: Sat Dec 08, 2007 9:30 pm Post subject: RE:Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
That's pretty cool.
@Vilament having the source code is good enough to learn from. And the poster isn't obliged to comment anyway. |
|
|
|
|
|
LaZ3R
|
Posted: Sat Dec 08, 2007 10:06 pm Post subject: RE:Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
Very neat!
Very very neat in fact!! |
|
|
|
|
|
Sean
|
Posted: Sun Dec 16, 2007 7:09 pm Post subject: Re: Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
I actually have shown this off so many times, really well designed. |
|
|
|
|
|
petree08
|
Posted: Mon Dec 17, 2007 10:52 am Post subject: RE:Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
Yeah lol I made a very simular thing to this a while ago under the topic "I've finaly tried 3d" just from a brief look at the code i see that you've used simular calculations in drawing the lines. Looking at this i can greatly improve my own model. Good job man |
|
|
|
|
|
agnivohneb
|
Posted: Mon Dec 17, 2007 1:46 pm Post subject: RE:Spinning "Party Tent" or Halo ring and Somewhat 3D |
|
|
NEATO
+ Karma for using the turing syntax tag |
|
|
|
|
|
|
|