----------------------------------- Kuntzy Sat Jan 31, 2004 5:53 pm Attempt at 3D ... ----------------------------------- This is my first attempt at a 3d anything, the pyrimd moves into the distance ... i'm still messing around with other stuff to make it rotate. ----------------------------------- Paul Sat Jan 31, 2004 5:55 pm ----------------------------------- wow that looks really good, would it work if the faces were colored? BTW, I kept on clicking "just click here" and nothing happened. :wink: ----------------------------------- TheXploder Sat Jan 31, 2004 6:03 pm ----------------------------------- hey that's great I once did something like that and it was a race game as a brids eye view ans the tall buildings moved by, it wasn't in turing though... ----------------------------------- Kuntzy Sat Jan 31, 2004 6:07 pm ----------------------------------- Yeah, i'm not quite sure how to add faces to the object, if someone can i'd be interested in seeing the code. ----------------------------------- Cervantes Sat Jan 31, 2004 6:25 pm ----------------------------------- that's the simplest 3d engine I've seen that I might actually have a chance of understanding :) (esp cuz the others are exe :lol:) good work!! ----------------------------------- Andy Sat Jan 31, 2004 6:41 pm ----------------------------------- it looks the same if u use pic.scale ----------------------------------- Catalyst Sat Jan 31, 2004 7:01 pm ----------------------------------- nice work :D ----------------------------------- sport Sun Feb 01, 2004 12:10 pm ----------------------------------- Nice program ----------------------------------- Cervantes Sun Feb 01, 2004 1:50 pm ----------------------------------- dodge its not just scaled its rotated too :D (forgive me if that'd didn't make any sense, I haven't read the code yet :? ) ----------------------------------- shorthair Sun Feb 01, 2004 1:52 pm ----------------------------------- The code isnt that complex , it gives off an awsome affect , you should texture the sides to show rotation ----------------------------------- Cervantes Sun Feb 01, 2004 2:07 pm ----------------------------------- that's what he was trying to do I would assume when he said "Yeah, i'm not quite sure how to add faces to the object, if someone can i'd be interested in seeing the code." Cheers ----------------------------------- Homer_simpson Sun Feb 01, 2004 11:07 pm ----------------------------------- sexy! now try adding rotation... note: you're going to have rotating every point of yer object around a center... you can find the center of yer object by getting the average of x,y and z pointes separately.. ----------------------------------- sport Mon Feb 02, 2004 6:58 pm ----------------------------------- It is rotating, just can't see cause it is the same color. ----------------------------------- Catalyst Mon Feb 02, 2004 7:03 pm ----------------------------------- its not rotating thats just a perspective effect ----------------------------------- shorthair Mon Feb 02, 2004 7:12 pm ----------------------------------- Are you sure , if you slow it down it loks like its rotating ----------------------------------- Andy Mon Feb 02, 2004 7:19 pm ----------------------------------- no the shrinking of it makes it look like its rotating cuz the lines arent straight ----------------------------------- Catalyst Mon Feb 02, 2004 8:11 pm ----------------------------------- i think its being moved inward probably makes the rotational effect ----------------------------------- Kuntzy Mon Feb 02, 2004 9:24 pm ----------------------------------- yeah it's not rotating its just the persepective, the math for rotation is still a bit fussy to me, but anyway homer and catalyst are right. and also pic scale or pic rotate is slower for turing to run, simple lines and math and a much faster approach for your game. ----------------------------------- TheXploder Mon Feb 02, 2004 11:03 pm ----------------------------------- but what if you draw polygons instead of simple lines, that could work... ----------------------------------- Catalyst Mon Feb 02, 2004 11:04 pm ----------------------------------- this should help proc Rotate (X,Y,Z, XA, YA, ZA : real) relZ := (((Z - z) * cosd (XA)) + ((Y - y) * sind (XA))) relY := (((Y - y) * cosd (XA)) - ((Z - z) * sind (XA))) y := Y - relY z := Z - relZ relZ := (((Z - z) * cosd (YA)) + ((X - x) * sind (YA))) relX := (((X - x) * cosd (YA)) - ((Z - z) * sind (YA))) x := X - relX z := Z - relZ relX := (((X - x) * cosd (ZA)) + ((Y - y) * sind (ZA))) relY := (((Y - y) * cosd (ZA)) - ((X - x) * sind (ZA))) y := Y - relY x := X - relX end Rotate ----------------------------------- Kuntzy Tue Feb 03, 2004 8:58 pm ----------------------------------- wow, thanx catalyst ... don't know what to say ----------------------------------- valor Wed Mar 24, 2004 10:33 pm ----------------------------------- wow thats sweet, i didnt know that turing could make 3d things, very interesting ----------------------------------- zylum Wed Mar 24, 2004 11:58 pm ----------------------------------- here's the source to a very simple wireframe program which is really a simplified version of my full 3d engine: setscreen ("offscreenonly") const faces := 8 const perspective := 250 var xpp : array 1 .. faces, 1 .. 3 of real := init (-50, 0, 50, 50, 0, 50, -50, 0, 50, -50, 0, -50, -50, 0, 50, 50, 50, 50, -50, 0, 50, -50, -50, -50) var ypp : array 1 .. faces, 1 .. 3 of real := init (0, 50, 0, 0, 50, 0, 0, 50, 0, 0, 50, 0, 0, -50, 0, 0, -50, 0, 0, -50, 0, 0, -50, 0) var zpp : array 1 .. faces, 1 .. 3 of real := init (50, 0, 50, 50, 0, -50, -50, 0, -50, -50, 0, 50, 50, 50, 50, 50, 0, -50, -50, -50, -50, -50, 0, 50) var xp : array 1 .. faces, 1 .. 3 of real var yp : array 1 .. faces, 1 .. 3 of real var zp : array 1 .. faces, 1 .. 3 of real var x : array 1 .. 3 of int var y : array 1 .. 3 of int var z : array 1 .. 3 of int var ax, ay, az : int := 0 var mx, my, md : int procedure rotate (face : int) var temp : real for i : 1 .. 3 yp (face, i) := ypp (face, i) * cosd (ax) - zpp (face, i) * sind (ax) zp (face, i) := zpp (face, i) * cosd (ax) + ypp (face, i) * sind (ax) temp := zp (face, i) zp (face, i) := zp (face, i) * cosd (ay) - xpp (face, i) * sind (ay) xp (face, i) := xpp (face, i) * cosd (ay) + temp * sind (ay) temp := xp (face, i) xp (face, i) := xp (face, i) * cosd (az) - yp (face, i) * sind (az) yp (face, i) := yp (face, i) * cosd (az) + temp * sind (az) x (i) := round (xp (face, i) / (1 - zp (face, i) / perspective)) + maxx div 2 y (i) := round (yp (face, i) / (1 - zp (face, i) / perspective)) + maxy div 2 end for end rotate loop drawfillbox (0, 0, maxx, maxy, 200) mousewhere (mx, my, md) ax := my mod 360 ay := mx mod 360 for i : 1 .. faces rotate (i) drawpolygon (x, y, 3, black) end for View.Update end loop -zylum ----------------------------------- the_short1 Fri Mar 26, 2004 6:29 pm ----------------------------------- leave it to zylum to create the most complex and wicked programs.... . nice 3d triangle...kruntz......... have urs rotate would look wicked.... also having the lines drawn in a neon ./ bright color and having the backround color black would look sweet and zylumm... THAT IS AMZING!!!!!!!!!!!!!!! ----------------------------------- zylum Fri Mar 26, 2004 6:51 pm ----------------------------------- it's really not that complicated once you know trig... the hard part is rotating the points in 3d space (the rotate procedure)... and that's ALL trig... so after grade 10 math you should be able to make a basic 3d wireframe program like the one above :wink: -zylum ----------------------------------- the_short1 Fri Mar 26, 2004 7:02 pm ----------------------------------- im from BC.,.,. since highscoll in BC starts at gr.8... i did trig and everyting last year.... so... i have done everything for most clases last year,... sucks repeating... but meh.!.... some things they teach are different ... but the basics i already learned... geting VERY BORING in math... next year in compsci i will be integrating math into compsci... rite now its still too much object thinking... and ill just wait... but math.,.. ERR!!!! feel like killing myself having to listen to the teacher explain something i alredy know for like 2 hours... :roll: :evil: :evil: :evil: :evil: :evil: :x :x :x :x :x :x :x ----------------------------------- RETARD32 Sat Apr 03, 2004 10:24 pm ----------------------------------- If you think that wire fram is good than you should see some of the things that catalyst has made. ----------------------------------- Delta Sun Apr 18, 2004 11:24 pm ----------------------------------- Your wireframe is screwed to the max zylum... your rotating something in there wrong because if you make the spikes (open sides) face towards you and then move them left and right you can see that they rotate wrongly. But otherwise it looks nice... just fix the rotation problem