Docs
Moderator: Moderators
I'm thinking of adding this to the docs. Would someone else confirm I have it correct.
title - the OpenGL difference
Many users are confused by the co-ordinate system of OpenGl.
OpenGl vs DirectX -
2D - Both are the same. Looking at your monitor -
X is horizontal
Y is vertical
3D - X,Y the same.
DirectX : If your monitor could expand to your size
and if you stood up and could walk thru it, you
would be looking at the Z co-ordinate.
OpenGl : Lay back in your chair, put your feet on
the screen, and look at the ceiling. Your are
looking at the Z co-ordinate.
------------------------------------------------------
I think that's wrong - try this -
OpenGl : Push your monitor over backwards so it is facing up . Look up at the ceiling at the Z-co-ordinate.
title - the OpenGL difference
Many users are confused by the co-ordinate system of OpenGl.
OpenGl vs DirectX -
2D - Both are the same. Looking at your monitor -
X is horizontal
Y is vertical
3D - X,Y the same.
DirectX : If your monitor could expand to your size
and if you stood up and could walk thru it, you
would be looking at the Z co-ordinate.
OpenGl : Lay back in your chair, put your feet on
the screen, and look at the ceiling. Your are
looking at the Z co-ordinate.
------------------------------------------------------
I think that's wrong - try this -
OpenGl : Push your monitor over backwards so it is facing up . Look up at the ceiling at the Z-co-ordinate.
In writing expressions/
C-style-loops
the example is for(int x=0; x<4; x++){do something ;}
1) you forgot the end semi-colon on your page - no big deal.
2) the "int" - Like... is it required or optional? I would have thought integer would be the default. Else, what's required to use floats?
3) Any way to break out of loops before finished?
C-style-loops
the example is for(int x=0; x<4; x++){do something ;}
1) you forgot the end semi-colon on your page - no big deal.
2) the "int" - Like... is it required or optional? I would have thought integer would be the default. Else, what's required to use floats?
3) Any way to break out of loops before finished?
Hello,
1) The "do something" is commented out using "//" .. so it doesn't need a semi-column
2) Variables have to be initialized one way or the other. So when you want to use a global variable that is already defined by the DefineVariable Component, you can simply write ..
But in case you want to use a local variable ( only exists within the scope that it is defined in ), initializing the variable as you need it is most convenient ..
Change "int" into "float" when you want to use a floating point variable.
3) Yes, although not in the way you'd normally do in other languages ( the break instruction isn't supported yet ). Either use a variable that you test in the for loop like so ..
Or you can use the "return" instruction without actually returning a value.
K
1) The "do something" is commented out using "//" .. so it doesn't need a semi-column
2) Variables have to be initialized one way or the other. So when you want to use a global variable that is already defined by the DefineVariable Component, you can simply write ..
Code: Select all
for(x=0; x<4; ++x){expression;}
Code: Select all
for(int x=0; x<4; ++x){expression;}
3) Yes, although not in the way you'd normally do in other languages ( the break instruction isn't supported yet ). Either use a variable that you test in the for loop like so ..
Code: Select all
for(int x=0; x<4 && done==0; ++x){expression;}
Code: Select all
for(int x=0; x<4; ++x)
{
if(done)return;
expression;
}
Last edited by Kjell on Mon Dec 07, 2009 2:48 pm, edited 1 time in total.
Not exactly ..
When a Array is not persistent, all cells / slots will be 0 every time you start your build ( please note that the values aren't reset to 0 when starting a preview ).
When a array is persistent, the values of the array are stored in your project file and thus can contain data other then 0 upon start ( setting a Array to persistent will also enable the "Edit Array Values" dialog ). However, this doesn't mean that the values are constant / unchangeable, any changes made to the Array through script in the Editor will be permanent.
K
When a Array is not persistent, all cells / slots will be 0 every time you start your build ( please note that the values aren't reset to 0 when starting a preview ).
When a array is persistent, the values of the array are stored in your project file and thus can contain data other then 0 upon start ( setting a Array to persistent will also enable the "Edit Array Values" dialog ). However, this doesn't mean that the values are constant / unchangeable, any changes made to the Array through script in the Editor will be permanent.
K
OK. That explains a problem I've been having.
Also points out another difference between preview and build with arrays. I'll document it.
Thanks again.
EDIT- In practice I've found a slightly different behavior of Persistent, which is useful in error checking. I found that if the values of a persistent array are changed during preview runtime , upon the next preview run of the project the new values are now initially in the array.
This means you can set an array to persistent, run preview, stop and then view the resulting values in your array.
Also points out another difference between preview and build with arrays. I'll document it.
Thanks again.
EDIT- In practice I've found a slightly different behavior of Persistent, which is useful in error checking. I found that if the values of a persistent array are changed during preview runtime , upon the next preview run of the project the new values are now initially in the array.
This means you can set an array to persistent, run preview, stop and then view the resulting values in your array.
Last edited by y offs et on Tue Dec 08, 2009 3:29 am, edited 2 times in total.
Kjells answers are excellent and 100% correct . You guys can write much better documentation than me. I need to update the wiki with the latest zge-components and I might take some bits from yoffsets help file because it's more up to date than the wiki. Yoffset let me know if you want the wiki-password if you want to help edit the online-help too.
@y_offs_et
The entry in the wiki isn't sufficient? I guess you could add that void / int / float are the only valid function types as of yet.
In case you want to add information on the concept of functions in programming / scripting languages .. this tutorial is pretty accurate for ZGE*
*Page I only ( ZLibrary's don't support variable declarations outside of functions though ) .. not page II, where they explain referenced arguments, function overloading and other features not supported by ZGE.
K
The entry in the wiki isn't sufficient? I guess you could add that void / int / float are the only valid function types as of yet.
In case you want to add information on the concept of functions in programming / scripting languages .. this tutorial is pretty accurate for ZGE*
*Page I only ( ZLibrary's don't support variable declarations outside of functions though ) .. not page II, where they explain referenced arguments, function overloading and other features not supported by ZGE.
K
Something you might want to reconsider .. I noticed you're using tags to manually? wrap / indent sentences. However, this only looks the way it should when the content window is around 620 pixels wide. As soon as it's another width, the spacing happens in the wrong places.
Also, you might want to move all visual elements to a css file / header instead of wrapping each element individually. For example, on the Getting Started page alone you have 217 (!) statements to define the font to be Arial. Once per page ( or once for the whole help file ideally ) should be sufficient. Makes it easier to change, plus saves kb's as well
Let me know if you need any help with this.
Keep up the good work ~
K
Er, umm, well, I'm just a poor plebe bumbling along, filling in the blanks of a freeware application. Perhaps you may want to look here.
www.vizacc.com
I'm more concerned that I have the content correct.
www.vizacc.com
I'm more concerned that I have the content correct.