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'.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
Funtion
Re: ..
- The glory days.
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):I just need help .. to make a function in c++ called: " Scale " that can scale
my object's instead of " setScale "
Code: Select all
void Scale(ISceneNode* node, float ratio)
{
if (node != 0)
node->setScale(core::vector3df(ratio, ratio, ratio));
}
Code: Select all
ISceneNode* yourObject;
void Scale(float ratio)
{
if (yourObject != 0)
yourObject->setScale(core::vector3df(ratio, ratio, ratio));
}
P.S.: if it is not what you need, please tell more info about what you particularly need.
Re: ..
At the risk of feeding the troll,
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,
or
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.
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:I just need help .. to make a function in c++ called: " Scale " that can scale
my object's instead of " setScale "
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!")
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);
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.
R
hier .. mein Freund:
Code:
To use it:
Code:
Code: Select all
void Scale(IAnimatedMeshSceneNode* SceneNode, f32 X, f32 Y, f32 Z)
{
SceneNode->setScale (vector3df( X, Y, Z)); // X, Y, Z
}
Code: Select all
Scale(node, 0.6f,0.6f,0.6f);
why are you wrapping irrlicht in a c-style api?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: c++ Function Code
i like it that way
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()
...
oh my i think i just saw a little bit of hell right there...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Re: c++ Function Code
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.M4UNOT wrote: i like it that way