Beta release 3.1b
Moderator: Moderators
Ville, ortho camera is working very well also in ES2/GL3 mode now. Thanks!
Question: would it be possible to change the OrthoZoom parameter to use some "better" values? I want to display larger objects (of dimensions several hundredths) and the OrthoZoom parameter is usually set to values 0.000*** (10^-4 - 10^-6). Some larger values would be more practical.
Question: would it be possible to change the OrthoZoom parameter to use some "better" values? I want to display larger objects (of dimensions several hundredths) and the OrthoZoom parameter is usually set to values 0.000*** (10^-4 - 10^-6). Some larger values would be more practical.
Hi guys,
Works fine now yes
K
Works fine now yes

I wouldn't be opposed to inverting the behavior ( by removing the "1.0/" here ) .. i guess in this case practicality is more important than being conceptually sound.Rado1 wrote:Would it be possible to change the OrthoZoom parameter to use some "better" values?
K
I've made this change now, beta updated.Kjell wrote: I wouldn't be opposed to inverting the behavior ( by removing the "1.0/" here )
Btw, it is good that Ortho works now. However I would like to know what the problem really was.
When I did glGetMatrix directly after glLoadIdentity/glOrtho in GL fixed mode I got this:
Code: Select all
((0.64, 0, 0, 0),
(0, 1, 0, 0),
(0, 0, -0.02, 0),
(0, 0, -1.002, 1))
Code: Select all
((0.64, 0, 0, 0),
( 0, 1, 0, 0),
(0, 0, -0.02, -1.002),
(0, 0, 0, 1))
Code: Select all
M[0] := Vector4f(2/m_rl, 0, 0, p_rl/m_lr);
M[1] := Vector4f(0, 2/m_tb, 0, p_tb/m_bt);
M[2] := Vector4f(0, 0, 2/m_nf, 0); //<<- moved "p_fn/m_nf" from this line
M[3] := Vector4f(0, 0, p_fn/m_nf, 1); //<<- to this line changed

:facepalm
.. but your version already worked because "p_rl/m_lr" and "p_tb/m_bt" are always 0 anyway.
K
Can't believe i didn't notice this earlier .. but you're assigning Vector4's per column, which essentially "rotates" the layout of elements in your source. In other words, this is the correct matrix ..VilleK wrote:What is going on here?
Code: Select all
M[0] := Vector4f(2/m_rl , 0, 0, 0);
M[1] := Vector4f(0 , 2/m_tb, 0, 0);
M[2] := Vector4f(0 , 0, 2/m_nf, 0);
M[3] := Vector4f(p_rl/m_lr, p_tb/m_bt, p_fn/m_nf, 1);
K
Updated today.
- Fixed the division by zero problem reported by Rado1
- Added support for declaring global variables directly in ZLibraries (as an alternative to using Variable-components).
For example, this is now valid syntax:
Download here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Fixed the division by zero problem reported by Rado1
- Added support for declaring global variables directly in ZLibraries (as an alternative to using Variable-components).
For example, this is now valid syntax:
Code: Select all
//These are global variables
int x;
int[5,5] xx,yy;
string s;
string[10] ss;
void f() {
//The global variables can be used in functions or anywhere in the application (after they have been declared)
x=0;
xx[0,0]=42;
s="hugo";
ss[0]="test";
}
Auxiliary global variables put to ZLibrary is quite a useful concept if used for internal processing accessible mainly by a facade of functions. Variable components can then be used just for important global variables commonly used in other components. This would make a project more comprehensive.
Does it make sense also to declare usually used local iterators and variables as global? For instance, iterator i in for(int i; ...) to be global, so each expression with such a command does not need to declare its local variable. What's the runtime processing overhead of declaring local variables? Are they allocated each time a ZExpression is running, or are variables pre-allocated and reused each time an expression is running?
Does it make sense also to declare usually used local iterators and variables as global? For instance, iterator i in for(int i; ...) to be global, so each expression with such a command does not need to declare its local variable. What's the runtime processing overhead of declaring local variables? Are they allocated each time a ZExpression is running, or are variables pre-allocated and reused each time an expression is running?
Hi Rado1,
Even when coding in assembly for 8-bit systems you generally keep a stack ( virtually all CPU's support it on a hardware level anyway ), it's simply not worth it.
K
Nah, the overhead is neglectable .. and you don't want to ( accidentally ) run into situations where both a function and the scope from which that function is called use the same global variable.Rado1 wrote:Does it make sense also to declare usually used local iterators and variables as global?
Even when coding in assembly for 8-bit systems you generally keep a stack ( virtually all CPU's support it on a hardware level anyway ), it's simply not worth it.
K
Declaring global variables directly in the code also makes it easier to convert OpenGL examples from C, this was the main reason I implemented the feature.
edit: what Kjell said.
Not really, because local variables are accessed faster than globals.Rado1 wrote:Does it make sense also to declare usually used local iterators and variables as global?
edit: what Kjell said.
Small maintenance update:
- Fix for bug reported by Kjell when inserting items from "Add from library"
- Temporary hide hints while app preview is active as workaround for render problem experienced by Rado1
Download here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Fix for bug reported by Kjell when inserting items from "Add from library"
- Temporary hide hints while app preview is active as workaround for render problem experienced by Rado1
Download here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
The problem is that last time I checked the docs for Live Wallpaper it required very different Java-classes and manifest file compared to when making a normal App. So we would need to have two sets of Java code etc which is a maintenance problem. Maybe it is easier now, if you find any resources on the net on how to convert an app to live wallpaper please post it here.Rado1 wrote:Returning back to an older request of Jph, would it be possible to build ZGE application as android live wallpaper?
Of course Ville, live wallpaper would require different generating of the android building directory with different manifest file, res/xml directory for wallpaper description xml file, java class for wallpaper service instead of activity class, etc.
There's an example of creating OpenGL live wallpapers with GLWallpaperService. Some explanation can be found also here. Another explanation how to make OpenGL ES live wallpaper here. I'm not sure it can be useful for you.
There's an example of creating OpenGL live wallpapers with GLWallpaperService. Some explanation can be found also here. Another explanation how to make OpenGL ES live wallpaper here. I'm not sure it can be useful for you.
GLWallPaperService looks potentially like it would work to adapt the existing ZGE Java classes (Zge.java and ZgeActivity.java) to use that instead. I'm up to my neck in other work at the moment though so I don't have much time to investigate. But if you or anyone else feel like trying it out I can help if you get stuck.