Would have been nice if it was identical to how you access individual vector elements of components.
Code: Select all
// So, like this ..
App.CameraPosition.X = 1;
// instead of this ..
App.CameraPosition[0] = 1;
K
Moderator: Moderators
Code: Select all
// So, like this ..
App.CameraPosition.X = 1;
// instead of this ..
App.CameraPosition[0] = 1;
Code: Select all
void fnc(vec3 a){...} // function definition
fnc(vec3(10, 2.2, 3.5)); // function calling
Code: Select all
// constructs vec3 from 3 floats
vec3 _vec3(float x, float y, float z){
vec3 result;
result[0] = x;
result[1] = y;
result[2] = z;
return result;
}
Code: Select all
vec3 result = {x, y, z};
I don't think it should be necessary / high-priority to add variable types that are basically a array of a already supported type without any specific functions / operators to compliment them. Should be only a minor inconvenience to return a vec2 / vec4 as float[] instead.Rado1 wrote:When doing rotations with quaternions I would really appreciate vec4. For texture mapping vec2. Any chance to have them added?
Of course it is not necessary, just little bit convenient and type safer, because float[] covers vectors of any length. It might be a problem if instead of expected float[4] is passed float[2] array as argument of a function call.Kjell wrote:I don't think it should be necessary / high-priority to add variable types that are basically a array of a already supported type without any specific functions / operators to compliment them.
For instance, in one of my projects, I wanted to achieve "static" textures mapped to objects of different sizes and placed on different positions. Objects are created by VBOs. By "static" I mean that the placement of texture depends on world's coordinates, not on position of objects it is placed on. Here, the texture coordinates used coordinates of mesh points. See the attached example which demonstrates the effect. Mouse changes the camera rotation, LMB moves forward and RMB moves backward.Kjell wrote:Out of curiosity .. why do you need vec2 for texture mapping? Aren't bytes ( when the texture is 256x256 pixels or smaller ) or shorts usually sufficient?
Probably not the best example to prove your point. You have the same data ( interleaved with the Z position ) twice. Simply re-use your vertex position buffer for the texture coordinates as well.Rado1 wrote:For instance, in one of my projects, I wanted to achieve "static" textures mapped to objects of different sizes and placed on different positions. Objects are created by VBOs. By "static" I mean that the placement of texture depends on world's coordinates, not on position of objects it is placed on. Here, the texture coordinates used coordinates of mesh points. See the attached example which demonstrates the effect.
This is a problem with the current implementation and it's the same reason why Kjell could not pass an array of mat4 to shaders. I need to rearrange how mat4 and vec3's are stored in memory. Using DefineArray as an underlying storage will probably have to be replaced with raw memory. This should not affect anything on the syntax level of things though.Rado1 wrote:Question: In the example, float[400,12] Faces array was used for vertex array buffer. I tried to use vec3[400,4] Faces, but does not work. Where's the problem?
Ville, you are right. It is simple to create an OUYA application with SDK. Unfortunately, it is relatively difficult to create an external library with NDK - a lot of JNI would be needed, no guarantee that it is even possible in ZGE. My original intention was to create an external library for OUYA, but failed (at the moment).VilleK wrote:I'm under the impression that it should not be too hard to adapt a normal Android app to be Ouya compatible? Maybe Rado1 or someone else with ZGE Android experience can take a quick look at it.
I had a look at API and it would be necessary to create a wrapper for ZGE. My question is: is it really necessary? AFAIK FreeType is a font engine/server used to generate glyph images. Why not to use pregenerated font bitmaps instead?VilleK wrote:Freetype: There is an official freertype multiplatform library so the best way would perhaps be to see if this can be used as an ExternalLibrary from ZGE.