Pages:
Author

Topic: The Coding Thread - page 3. (Read 2753 times)

staff
Activity: 3290
Merit: 4114
May 15, 2013, 05:56:41 PM
#13
It would be really great if this got added as a sub-forum. I know it can be related to services etc.
But, this just seems like a great way to break it up from the other things located in other sections, however I don't have anything to add at this moment as i'm mainly a python programmer, and learning java now.
legendary
Activity: 1540
Merit: 1000
May 15, 2013, 05:40:05 PM
#12
Hmm, does anyone know of any good examples or tutorials for Codeblocks that show you how to code interaction with the shapes you make?

I may have just found what I needed Cheesy just needed to look for a bit longer.

http://www.codeproject.com/Articles/27219/TetroGL-An-OpenGL-Game-Tutorial-in-C-for-Win32-Pla
legendary
Activity: 1540
Merit: 1000
May 15, 2013, 05:21:56 AM
#11
I dunno about that, I don't think I want to use anything particularly pre-made I think the only thing I've done that's pre-made so far is use the Codeblocks OpenGL sample to get all the window setup that I need because the tutorials I've looked at are outdated with some of the stuff they have. I did notice some VK commands for all the keyboard stuff in the compiler so I'll have to have a look at the syntax involved with that so I can make stuff move.

Edit: AHA! Nehe seems to be very good with this stuff and it's just what I need, IF commands ftw! Cheesy
legendary
Activity: 3598
Merit: 2386
Viva Ut Vivas
May 15, 2013, 12:32:05 AM
#10
Have to admit, I think I'm starting to really enjoy messing around in OpenGL Cheesy I just need to figure out how to make it interactive.

I did some coding in OpenGL, it is pretty fun. I had to open up some of my old math books from college that I figured I would never need again.

For interaction, you should first start with using a key listener. Making stuff happen based upon various keyboard keys is fairly easy.
full member
Activity: 182
Merit: 100
May 14, 2013, 11:52:17 PM
#9
Just remember it's not the language that matters (okay, maybe it matters a little), it's the practices and techniques you learn from using that language. If you master the correct techniques, you'll pick up future languages faster, and produce better code and documentation.
legendary
Activity: 1540
Merit: 1000
May 14, 2013, 02:44:16 PM
#8
Have to admit, I think I'm starting to really enjoy messing around in OpenGL Cheesy I just need to figure out how to make it interactive.

Quote
             glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            glClear(GL_COLOR_BUFFER_BIT);

            glLoadIdentity();
            glPushMatrix();
            glTranslatef(-1.0f, -1.0f, 0.0f);
            glPushMatrix();
            glRotatef (90.0f, -180.0f, 0.0f, 0.0f);
            glPopMatrix();

                                            glBegin(GL_TRIANGLES);




                                            glVertex3f(0.5f, 0.5f, 0.0f);   glColor3f(2.0f, 0.5f, -1.0f);
                                            glVertex3f(1.5f, 0.5f, 0.0f);   glColor3f(1.0f, 0.5f, -1.0f);
                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(6.0f, 0.5f, -1.0f);

                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, -1.0f);
                                            glVertex3f(1.5f, 0.5f, 0.0f);   glColor3f(2.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);

                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.0f, 1.5f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);



            glEnd();

            glPopMatrix();


Coding spam woopeee! Cheesy
legendary
Activity: 1904
Merit: 1037
Trusted Bitcoiner
May 12, 2013, 10:38:35 PM
#7
i can do the job 2 of 3 ways;

Cheap, Fast, Good

if you want it:
Cheap & Fast,  fine, but it won't be very good.. (Dirty Code! lol )
Good & Cheap, ok, ill do my best!
Good & Fast,    sure, but thats not going to be cheap.  50,000BTC  Wink

 Tongue
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
May 12, 2013, 10:09:21 PM
#6
I would recommend reading Scott Meyers and Herb Sutter and keeping your focus on Standard C++ always (i.e. not extensions for specific compilers such as MSVC).

BTW - https://bitcointalksearch.org/topic/c-mentoring-203104.
full member
Activity: 182
Merit: 100
May 12, 2013, 03:20:32 PM
#5
I am interested in learning C++ mainly because that seems to be the most widely used language out there. I am already familiar with HTML because I've learned it some in school and have used it in creating my websites, and next year, I will be learning some Java as part of a course and will probably continue to mastery the following year. However, C++ I will need to learn by myself, so do you guys have any recommendations for me learning it by myself. My parents may help me as they both know C++ and multiple other coding languages.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
May 12, 2013, 09:52:28 AM
#4
I support a coding (sub-)FORUM
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
May 12, 2013, 09:34:30 AM
#3
Purely from a C++ coding style perspective I see no reason to be "indenting" the function calls you have (indenting is normally done for code *blocks* that are surrounded by braces or for conditional expressions).

You might consider using an "empty code block" to make it more express the indenting you are after though:

Code:
...
glPopMatrix();
{
   glBegin(GL_TRIANGLES);
   ...
   glEnd();
}

legendary
Activity: 826
Merit: 1002
amarha
May 12, 2013, 09:28:27 AM
#2
Nothing to add atm, but I support this idea for a thread.
legendary
Activity: 1540
Merit: 1000
May 12, 2013, 01:31:33 AM
#1
Considering there are clearly tons of programmers/learning programmers here I think we should make a thread where we can talk about different programming languages and help each other out, I'm currently messing around in OpenGL though I suspect if I want to make anything functional like a game I'm going to have to properly get into C++ too, feel free to post code here of stuff you're working on and need help with etc.


Quote


            glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            glClear(GL_COLOR_BUFFER_BIT);

            glLoadIdentity();
            glPushMatrix();
            glTranslatef(-0.5f, -0.5f, 0.0f);
            glPushMatrix();
            glRotatef (90.0f, -180.0f, 0.0f, 0.0f);
            glPopMatrix();

                                            glBegin(GL_TRIANGLES);




                                            glVertex3f(0.5f, 0.5f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 0.5f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);

                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 0.5f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);

                                            glVertex3f(0.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.5f, 1.0f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);
                                            glVertex3f(1.0f, 1.5f, 0.0f);   glColor3f(1.0f, 0.5f, 1.0f);



            glEnd();

            glPopMatrix();


I made a pink pentagon, WEEEEEEEEE! Cheesy Can't figure out how to get GLRotatef working though.
Pages:
Jump to: