Page 2 of 3

Re: ..

Posted: Mon Jun 28, 2010 8:30 pm
by Brkopac
M4UNOT wrote:slavik262

I don't need some basic C++ lessons

and i know how to create a lib ... Sudi see my videos:

http://www.youtube.com/user/m4unot
Your youtube channel in no way shape or form proves you have grasps of C++ or any other programming knowledge. A few solutions have been provided to you in this thread and yet you continue to assume that everybody else doesn't know what's going on. You should re-read and reflect. Just sayin'.

Posted: Mon Jun 28, 2010 8:33 pm
by ACE247
Well you seem to be a Soccer Fan. 8)(Judging by the song)
I'm for Germany! :P

Posted: Mon Jun 28, 2010 8:36 pm
by greenya
I just need help .. to make a function in c++ called: " Scale " that can scale

my object's instead of " setScale "
Ok, if you realize that "Scale" will also need an object to operate than next is your function (very same code was already posted above):

Code: Select all

void Scale(ISceneNode* node, float ratio)
{
    if (node != 0)
        node->setScale(core::vector3df(ratio, ratio, ratio));
}
If you don't want to pass "node" parameter, than "Scale" function should know "your object" some other way, for example:

Code: Select all

ISceneNode* yourObject;
void Scale(float ratio)
{
    if (yourObject != 0)
        yourObject->setScale(core::vector3df(ratio, ratio, ratio));
}
than you can set "yourObject" once and after this all calls to "Scale" will be done to that object. You get 1 argument function as requested i guess.

P.S.: if it is not what you need, please tell more info about what you particularly need.

Re: ..

Posted: Mon Jun 28, 2010 8:43 pm
by slavik262
At the risk of feeding the troll,
M4UNOT wrote:I just need help .. to make a function in c++ called: " Scale " that can scale

my object's instead of " setScale "
To do so requires a very simple understanding of fundamental C++ programming concepts. If you don't know how to do this yourself, then yes, you should read up on some lessons.
M4UNOT wrote:see my videos:

http://www.youtube.com/user/m4unot
Are these supposed to impress us with your programming knowledge? It's one thing to hack together a program based on things you've found; it's quite another to understand the fundamental concepts of what you're doing and build upon them. Your question on these forums shows you don't know the basic concepts of C++. The members of the forum would be happy to help you with understanding these concepts, but asking for help works a lot better than accusing all of us of knowing nothing.

Your "API" videos only strengthen my opinion that you don't know what you're doing. If writing confusing and pointless wrappers around console input and output functions is supposed to impress us, try again. The most important part of programming isn't writing code, but understanding the problems you're faced with and breaking them down into problems that can be solved with programming logic. Also very important to programming is writing code that is expressive - code that is easy to understand and that serves an obvious purpose. The standard library was designed with this in mind: cout (console out) and printf (print function) are straightforward functions that do exactly what you would expect given expected parameters. The same goes for system(), which runs a given system command. To obfuscate these into misleading/confusing functions like Main() and New() to the point where it's hard to even tell what they do is pointless and stupid. Which is easier to understand,

Code: Select all

printf("Hello World!")
or

Code: Select all

char* p=new char[1024];++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;while(*p){++p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++p;++*p;++*p;++*p;++p;++*p;--p;--p;--p;--p;--*p;}++p;++*p;++*p;putchar(*p);++p;++*p;putchar(*p);++*p;++*p;++*p;++*p;++*p;++*p;++*p;putchar(*p);putchar(*p);++*p;++*p;++*p;putchar(*p);++p;++*p;++*p;putchar(*p);--p;--p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;putchar(*p);++p;putchar(*p);++*p;++*p;++*p;putchar(*p);--*p;--*p;--*p;--*p;--*p;--*p;putchar(*p);--*p;--*p;--*p;--*p;--*p; --*p;--*p;--*p;putchar(*p);++p;++*p;putchar(*p);++p;putchar(*p);
Both do the same thing, but the first one is clearly easier to understand and use.

Sorry if I offended you, but you asked for it when you accused everyone on this forum of not knowing how to write a function even after several people had helped you. :P

Re

Posted: Mon Jun 28, 2010 8:52 pm
by M4UNOT
Thanks, Guy's

Vielen Dank an alle hier in diesem forum 8)

Posted: Mon Jun 28, 2010 8:54 pm
by slavik262
I'd love to see his code. :P

R

Posted: Mon Jun 28, 2010 8:59 pm
by M4UNOT
hier .. mein Freund:

Code:

Code: Select all


void Scale(IAnimatedMeshSceneNode* SceneNode, f32 X, f32 Y, f32 Z) 
{ 
    SceneNode->setScale (vector3df( X, Y, Z));  // X, Y, Z
} 


To use it:

Code: Select all


Scale(node, 0.6f,0.6f,0.6f);

:roll:

Posted: Mon Jun 28, 2010 9:00 pm
by slavik262
I almost heard a whistling sound as the entire point of Object Oriented Programming flew over your head.

a

Posted: Mon Jun 28, 2010 9:02 pm
by M4UNOT
Hahaha :D

Posted: Mon Jun 28, 2010 9:12 pm
by sudi
why are you wrapping irrlicht in a c-style api?

Re: c++ Function Code

Posted: Tue Jun 29, 2010 6:42 pm
by M4UNOT
:wink: i like it that way

Posted: Tue Jun 29, 2010 7:22 pm
by Virion
you can try to wrap the whole irrlicht lib into your C-style functions. go ahead your future is bright.

add: *sarcastic*

Posted: Tue Jun 29, 2010 7:33 pm
by greenya

Code: Select all

...
#define Scale(node,x,y,z) node->setScale(vector3df(x,y,z))
#define Position(node,x,y,z) node->setPosition(vector3df(x,y,z))
#define Rotation(node,x,y,z) node->setRotation(vector3df(x,y,z))
...
#define Drop(referenceCounted) referenceCounted->drop()
#define Grab(referenceCounted) referenceCounted->grab()
...
:roll:

Posted: Tue Jun 29, 2010 10:36 pm
by sudi
oh my i think i just saw a little bit of hell right there... :D

Re: c++ Function Code

Posted: Tue Jun 29, 2010 10:58 pm
by DtD
M4UNOT wrote::wink: i like it that way
I had the same feeling about Object-Oriented programming a long time ago, but trust me, just take the time to learn and get used to oo stuff, it is way better and you won't be wasting time with silly wrappers like this.