Jump to content

3D Graphics college asignment

- - - - -

  • Please log in to reply
6 replies to this topic

#1
totonex

totonex

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
Hello everyone,

As posted earlier, here and here, i started (and finished) a 3D project for school, using only drawing primitives. (Second year faculty project).

I would like some destructive and/or constructive criticism of it, should any of you wish to give it. I am posting the full source code here, use it in whatever non-commercial way you wish !
Everything has been done with C#, GDI+.


This is not a 3D Engine. Features like backface culling, polygon texturing, frustum culling have not been implemented. Also, the code is not commented, but it's fairly straightforward.

System requirements: (Yes, it does sound weird!)
--------------------
- Windows XP 32 bit, or something compatible.
- Standard Windows fonts installed. Preferable to have Agency FB, but Arial will do (The code looks for fonts in a particular order...Arial is its last option).
- A 3-button mouse.
- A powerful processor (dual core preferable ....yes GDI+ is slow).
- .NET framework 4.0 installed.

Thank you.

[ATTACH]3649[/ATTACH]

EDIT: I have done commenting on the code. I have reuploaded the project.

Attached Files


Edited by totonex, 21 January 2011 - 12:54 PM.


#2
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
I'm impressed with the code. It is extremely neat and well organized. And I was gonna test it out and run through it, but I need to install that .net emulator for Linux.. I'll do it tomorrow and give the source a better look because I'm wiped right now. Gonna go get some sleep.

I'm sad I missed out on helping you pick what language you were going to use. You used C# because it was easiest for you right?

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#3
totonex

totonex

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
In a nutshell, yes, C# was the easiest for me.
Allow me to write some of my history with programming.

In highschool, from the 9th to the 12th grade we worked with Borland C++ 3.1. Actually, it was C with cin>> and cout<<. We used that to learn basic stuff like pointers, arrays, functions etc. In the 12th grade, our teacher introduced us to Borland C++ Builder 5, which is a RAD. I even posted quite a few forum questions about Bcb5 on Codecall back then.

Being familiar to RADs, in the summer between 12th grade and the 1st year of college i learned PHP and C# from two books for noobs regarding those 2 languages. Microsoft's free Visual Studio C# Express 2008 was a real kick for me. All those shiny components, and a language like C#, which hid away pointers and such was great, and i did some projects in C#. I also learned a minimal amount of Java at school.
Meanwhile, i learnt a bit of Lisp, and i also picked up a bit of Python from MIT courseware. (TINY little bit).

I simply did not want Java for this project, because well, it's Java and also i did not know enough AWT.
It would have taken too much to learn Python's TKinter, and also too much to learn to GUI (if that's applicable as a verb...) in Lisp. I also dismissed Borland C++ 3.1 for DOS.

So yeah, C# provided the fast prototyping i needed (RAD + OOP), without the verboseness of Java. (If there's any Java coders out there, sorry! I can't back up this statement with actual proof :c-biggrin:)
Come on, C# is a great language. :c-cool:
This story is probably to back up my lack of competence in quickly learning a new GUI paradigm!

BTW: Should i comment the code and re-post it ?

#4
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
I would love for you to comment on it and repost. If you can remember what you were thinking or why you were doing the things you were doing at the time that would be great.

Now you have quite a bit of programming experience then. If C++ was your primary language throughout all of high school you must have been quite good with it.

Even though you spent 4 years with C++, you still ended up choosing a language that you learned in a few months between your senior year in high school and freshmen year in college. I understand that C# is a lot easier to program in. I'll admit it. I did a project for my school back in my senior year programming a custom database manager & image viewer. I spent about 3 days on it, a few hours a day. It had auto complete when you were doing searches, it was quite a little functional program. Doing the same thing in C++ would have taken me a week or more. ( I was still quite new to programming back then )

In your case though, your only requirement was to draw primitives. Isn't drawing primitives in OpenGL just as easy as drawing them in C#? I mean window creation/management sucks in C++, but if you use another library such as SDL or glut, that's all taken care of and the rest is just drawing operations and object calculations ( almost the same in any programming languages right ? )

I could understand if you were doing a lot of work with texturing, etc. C# and Java are amazing for loading images and displaying them. A few lines in those languages turns out to hundreds in C++. But the fact that it was just primitives still makes me wonder why you chose c#

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#5
totonex

totonex

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
I will comment and re-post tommorow. The code is very fresh in my mind.
Well there's the thing in C++: Learning a new 'thing', like you mentioned, the "such as SDL or glut". C# generates my forms 'n stuff automatically. Events, delegates etc. All wired up.
I had everything i needed in C#'s Graphics object:

Drawline
GraphicsPath (for connecting more lines)

I've seen some openGL code, but it looks rather cryptic for a new potential recruit, like me. If forms are involved, my mind is stuck to the RAD idea.
I haven't done C++ in highschool. I've done C with cout and cin. That's is NO classes and NO objects. I learned all the little OOP i know from C# and PHP.

#6
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
Ahh I see. Yeah in that case C# has got most everything done for you already :)

Gimi a sec.. still trying to setup mono and all that so I can use .net.

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#7
totonex

totonex

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
Done ! Commented (albeit i a rather unprofessional way) the code, and wiped some redundancies off.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users