Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
3-D triangle
Author Message
TheFerret

Posted: Thu May 06, 2004 9:06 am   Post subject: 3-D triangle

I have a 3-D triangle program that I have made and am wondering if it is possible to colour all the faces a different colour than the other...

3dtri.t
Description:
Filename:  3dtri.t
Filesize:  1.83 KB

Homer_simpson

Posted: Thu May 06, 2004 9:24 am   Post subject: (No subject)

TheFerret

Posted: Thu May 06, 2004 6:13 pm   Post subject: (No subject)

would you like to show an expample of is it too complicated...
guruguru

Posted: Fri May 07, 2004 9:39 pm   Post subject: (No subject)

A quick way to do it but it doesnt work with overlapping (you figure that out 8) ) is as follows for one face. You track three point throughout the whole program. These points must form a 2D triangle on one side. You then draw a polygon (check reference) and fill it a certain color. You use this tecqnique for the rest of the sides, but the overlapping gets tricky and im not going to get into that here.

This is a quick example that makes one side blue. Put the vars at the top and the other stuff where you draw the lines.

 code: var face1X, face1Y : array 1 .. 3 of int face1X(1) := x face1X(2) := c face1X(3) := z face1Y(1) := a face1Y(2) := b face1Y(3) := e        Draw.FillPolygon (face1X, face1Y, 3, blue)
TheFerret

Posted: Sat May 08, 2004 2:05 am   Post subject: (No subject)

I get what you mean and got it to work better (not perfect), I have all 4 polygons for the right var but when you run only 3 show up (but if you comment them out except one(different one each time) they show up)...

P.S. I am so tired, it is 3:05 AM here and I am working on a Turing program, GEEZ...

3dtri.t
Description:
 ZZZZZZZZZZZZZZZZZZZZZ....

Filename:  3dtri.t
Filesize:  2.81 KB

guruguru

Posted: Sun May 09, 2004 4:38 pm   Post subject: (No subject)

THis is where it gets difficult. Everytime the triangle rotates, a new side will be in front. But when you draw the faces, you are always drawing the faces in the same order with the same one in front. You have to keep track of which face is in front, second etc... Possible giving them z values might work. There are probally examples either int his forum, submissions forum, or in the tutorials. Take a quick look and good luck!
Homer_simpson

Posted: Mon May 10, 2004 10:48 pm   Post subject: (No subject)

fuck that...
http://www.whisqu.se/per/docs/graphics8.htm
http://www.whisqu.se/per/docs/graphics6.htm
http://www.whisqu.se/per/docs/graphics7.htm
http://www.whisqu.se/per/docs/graphics9.htm
TheFerret

Posted: Tue May 11, 2004 3:15 pm   Post subject: (No subject)

Now this is hard to do...

Homer_simpson

Posted: Thu May 13, 2004 3:16 pm   Post subject: (No subject)

but it's the actual way to do it... but dont even bother doing it in turing it's useless...
TheFerret

Posted: Thu May 13, 2004 5:06 pm   Post subject: (No subject)

I found a way to shade but it draws it dot by dot and is slow...
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 10 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: