A minor complaint and materials request...

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
DreamBliss
Posts: 30
Joined: March 27th, 2013, 11:48 pm
Location: Lost on the Way
Contact:

A minor complaint and materials request...

Post by DreamBliss » June 8th, 2013, 3:42 am

Before I start I want to thank Chili for the tutorials and all his hard work on them.

I just started to watch Lesson 10, and I'm left trying to figure out what I want to do next. I was very disappointed that Chili did not walk through the code for moving and re-sizing the cube, nor has he, as near as I can tell, ever posted the code and information on the multicolored design.

I can't speak for anyone else, but for me I learn by rote. Doing the same thing, over and over again, until it has been cemented in my mind. It is not enough to just do a thing either. When it comes to learning I also have to understand it.

I still do not have a clear enough understanding of moving stuff around and re-sizing things. I have no idea how to make any other shape than a square, and that was a struggle. I also have no idea as to how to make those cool designs. And I am not stupid when it comes to math. I'm going back through algebra and have just come to matrices and simplifying expressions with exponents. A lot of this I learned in college some years ago. I would say that while my memory may be a little rusty, I'm at an intermediate level of algebra. Perhaps this isn't high enough to know how to do these other shapes and colors. I am working on that. In the meantime it would be nice to have the code to follow and have the code well explained as well.

Anyhow I'm tired, worked pretty hard today, probably didn't get enough sleep. So I'm not making any decisions yet. But I'm not happy with the lack of explanation of going over of things i have experienced thus far in Chili's lessons. Not sure I will continue. Probably watch Lesson 10 all the way through when I am more alert before I decide.

Requesting greater explanation of the hows and whys of the things we are doing in the lessons. Requesting information on making shapes and colors - the geometric designs alluded to. Finally requesting that all homework is thoroughly gone over, so learning by rote and greater understand is the result.

Thank you for taking the time to read this. If anyone in the forums would like to help me I would appreciate it.
You create reality in your mind,
Before experiencing it as reality,
So if you want to change something,
First change what you think about it.

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: A minor complaint and materials request...

Post by viruskiller » June 8th, 2013, 8:38 pm

so i spent like 20 min trying to type an elaborate explanation on how to make a draw box function, then realized i can't really remember what the one chili teached us looked like.

anyway u should no be upset with this , chili had his reasons for not going into more depth with it, its really a trivial thing.

to change the box size you just need to implement it as a variable in the function parameters, then use it as a loop count limit.
to change the box position u need to change the coordinates u pass to it each frame. (i'm sure he showed some sample code with key press checks before that episode)

anyway i'll code what i think it was the actual draw box function, but i strongly recomend trying to do it yourself before reading it, programing isn't about reading stuff over and over till u learn it, that way the only thing u learn is to code stuff that others coded already,programing is about being creative, trying to code different then others, better or worse.
it may be that u're strugling because u didn't understand how nested loop works or the fact that the game runs in frames and the compose frame function is called 60 times per second, dunno, but i find it hard that ppl can't grasp how to move the box.

Code: Select all


void DrawBox(int xoff,int yoff,int size,int r,int g,int b)
{
      for(int y=0;y<size;y++)     /this loops trough the y coordinates
         {
          for(int x=0;x<size;x++)    // this loops trough the x coordinates; note that this loop runs with each increment in the y since is inside the other loop.
                   { 
                        PutPixel(xoff+x;yoff+y,r,g,b);
                    }
          }


}


User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: A minor complaint and materials request...

Post by viruskiller » June 8th, 2013, 8:44 pm

i myself kept and still wonder about ho the colored shapes code works, but i don't really care about it, i know that what's in it has nothing to do with the C++ programing language or direct x, is just a thing that u can do combining the two.

nG Inverse
Posts: 115
Joined: April 27th, 2012, 11:49 pm

Re: A minor complaint and materials request...

Post by nG Inverse » June 9th, 2013, 6:15 am

It's not C++ or DirectX specific, not really a combination of them either.

You can find numerous tutorials online for color manipulation - search there. Some may be in other languages, like Java, but that's fine, it's an easy convert.

User avatar
DreamBliss
Posts: 30
Joined: March 27th, 2013, 11:48 pm
Location: Lost on the Way
Contact:

Re: A minor complaint and materials request...

Post by DreamBliss » June 9th, 2013, 11:26 am

If you looked at my posts previous to this one you would see exactly what I have been struggling with. I will try to explain it here.

I understand loops and that things work frame by frame. Where I am fuzzy is...

How do I use functions in place of the loops? I figured out how to make the square with functions, one for x and one for y that called the function for x. But that was just a lucky guess. I don't understand the rules here.

I kinda get that User Variables are essentially constants, and that their values can not be changed directly, so we create variables equal to them and then change the value of those variables as needed. But I don't understand the rules here either.

I understand 3D and 3D space, Cartesian graph, etc. I get that the top left of the screen is 0, 0 and the bottom right is, currently, 800, 600. But I don't really understand how to make something move along a path, or re-size it, or even move it. Again I don't understand the rules here.

This is so hard to explain. Basically it feels like I have been parroting Chili, but have not been given enough information to understand what the heck I am doing. It's like I'm in a car with two steering wheels, two sets of pedals. I've watched my teacher drive for a few miles now, and he has suddenly given me control. But nobody every told me the rules of road or explained to me very well how the wheel and pedals work. But the driving example is simple to help you understand how I feel. Now imagine the same situation in a commercial airliner!

I will study the code you have provided and once I feel I understand it well enough I will code it myself. Thank you both for your replies.

The colors and geometry did interest me, very much so. I would really like to be able to know how to do this so I could play around with it. What understand I have gained so far was acquired just that way, by coding examples of things that really caught my interest.

Thanks again!
You create reality in your mind,
Before experiencing it as reality,
So if you want to change something,
First change what you think about it.

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: A minor complaint and materials request...

Post by viruskiller » June 9th, 2013, 1:02 pm

i'd recomend u watch some basic c++ tutorials , learn how functions work and how to pass values to them and so on, then when u come back to chili tutorials it will be much simpler.

what u need to understand is that u don't actually move the box, u just have to draw it with another starting origin. if u want to resize , again u don't resize anything, u just draw it of another size.
changing those variables using key press events shouldn't be hard once u know functions.

McSquizzy123
Posts: 22
Joined: July 15th, 2012, 6:07 pm

Re: A minor complaint and materials request...

Post by McSquizzy123 » June 16th, 2013, 5:39 am

http://www.youtube.com/watch?v=l8UeoizD ... ED1D61B9A4

I recommend this tutorial playlist for you in case you're still working on understanding functions and variables better. This guy explains everything very slow and in depth.

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: A minor complaint and materials request...

Post by Asimov » June 19th, 2013, 11:35 pm

Hi,

My view is that chilli does not tell you everything because that is the way you learn.
He gives you the building blocks. It is up to you to make the house.

I recommend learning C++ before tackling the videos, which helps a lot.

I started by rote kind of. Typing up endless code from Sinclair user magazines, only to find the damn thing wouldn't work at the end, and I ended up spending weeks bug tracking, but I learnt more from bug tracking than I did from typing it up.
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

malvarco
Posts: 1
Joined: June 26th, 2013, 8:11 pm

Re: A minor complaint and materials request...

Post by malvarco » June 27th, 2013, 7:19 am

Hi, I actually learnt the same way, using some Microhobby Spanish Sinclair ZX Spectrum BASIC programs, writing all night sometimes even till dawn. BASIC wasn't that different from C. C has more features you've got to learn, some procedural ways that are nowadays deprecated (GOTO, GOSUB, etc) but the programming fundamentals are similar.
Asimov wrote:
I started by rote kind of. Typing up endless code from Sinclair user magazines, only to find the damn thing wouldn't work at the end, and I ended up spending weeks bug tracking, but I learnt more from bug tracking than I did from typing it up.

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: A minor complaint and materials request...

Post by Asimov » June 27th, 2013, 4:59 pm

Hi malvarco,

Even in basic you can write code in an object orientated way.

Using "Gosubs" to call code and then a return was very much like using classes, except you couldn't easily send data and return data from a gosub.

In those days all data was public: but I enjoyed programming in sinclair basic.

You could make classic games like move the square block to the left, or move the block to the right, especially on the ZX81 heh heh.

I actually programmed in z80 machine code on the Spectrum 48k.
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply