December 04, 2011
On 12/2/2011 5:36 PM, David wrote:
> Hello,
>
> I am currently working on gl3n - https://bitbucket.org/dav1d/gl3n - gl3n
> provides all the math you need to work with OpenGL, DirectX or just
> vectors and matrices (it's mainly targeted at graphics - gl3n will never
> be more then a pure math library). What it supports:
>
> - dav1d

I can see myself using this.  Thanks for your work.

December 04, 2011
Ah finally, I spent today some work on adding and finishing the documentation, the result: http://dav1d.bitbucket.org/gl3n/index.html

Thanks for all your suggestions and the positive feedback so far :)

- dav1d

December 04, 2011
David:

> I am currently working on gl3n - https://bitbucket.org/dav1d/gl3n - gl3n provides all the math you need to work with OpenGL, DirectX or just vectors and matrices (it's mainly targeted at graphics - gl3n will never be more then a pure math library). What it supports:
> 
>   * vectors
>   * matrices
>   * quaternions
>   * interpolation (lerp, slerp, hermite, catmull rom, nearest)
>   * nearly all glsl functions (according to spec 4.1)
>   * some more cool features, like templated types (vectors, matrices,
>     quats), cool ctors, dynamic swizzling

This seems the 15th D implementation of certain things I've seen so far. Also to avoid further duplication I'd like 2D/3D/4D vectors (for game or graphics purposes) in Phobos.

Bye,
bearophile
December 05, 2011
On 12/04/2011 03:39 PM, bearophile wrote:
>This seems the 15th D implementation of certain things I've seen so far. Also to avoid further duplication I'd like 2D/3D/4D vectors (for game or graphics purposes) in Phobos.

Isn't he a nice guy ?
Since 5, maybe 6, years bearophile is complaining that D is not Python. And in case that bearophile is not in the mood to complain he fires up some obscure benchmarks or he is telling you why language X Y Z is better than D. Pretty annoying imho.

My 2 cents

OK, Somehow your announcement implicates that you've implemented a DirectX wrapper.  "gl3n provides all the math you need to work with OpenGL, DirectX or just vectors and matrices,,,

True ? Avail. ?
Bjoern
December 05, 2011
Am 05.12.2011 04:00, schrieb bls:
> On 12/04/2011 03:39 PM, bearophile wrote:
>> This seems the 15th D implementation of certain things I've seen so
>> far. Also to avoid further duplication I'd like 2D/3D/4D vectors (for
>> game or graphics purposes) in Phobos.
>
> Isn't he a nice guy ?
> Since 5, maybe 6, years bearophile is complaining that D is not Python.
> And in case that bearophile is not in the mood to complain he fires up
> some obscure benchmarks or he is telling you why language X Y Z is
> better than D. Pretty annoying imho.
>
> My 2 cents
>
> OK, Somehow your announcement implicates that you've implemented a
> DirectX wrapper. "gl3n provides all the math you need to work with
> OpenGL, DirectX or just vectors and matrices,,,
>
> True ? Avail. ?
> Bjoern
Hehe,
I wrote gl3n, because of a lack of alternatives and gl3n isn't intended to be merged into phobos!

Oh DirectX, it is "just" "vectors and matrices", I think I'll remove DirectX (also I never used DirectX, so I can't tell a lot about it), thanks for pointing it out.

- dav1d
December 05, 2011
Hi David,

what a lovely Library, very useful for me right now. I am using Derelict and have
just right now written my first Shader Projection Matrix ( as Uniform ). As far as
I can see, there is no code for a Projection Matrix in your Lib ( ignore this if I
have just missed it ), so the attached method should do it.
( I found the original code here:
http://www.geeks3d.com/20090729/howto-perspective-projection-matrix-in-opengl/ )

Now, a little embarrassing ... :-) I am with D for around 2 Weeks now, so ... how
can I actually use your modules ?
I am using VisualD, in the prefs I added the Path to the source code, but I am
getting "cannot find symbol blah" when I build my project. Any idea why ? The d
files are found, but what do I have to import ?

Cheers, ParticlePeter


December 05, 2011
Am 05.12.2011 13:30, schrieb ParticlePeter:
> Hi David,
>
> what a lovely Library, very useful for me right now. I am using Derelict and have
> just right now written my first Shader Projection Matrix ( as Uniform ). As far as
> I can see, there is no code for a Projection Matrix in your Lib ( ignore this if I
> have just missed it ), so the attached method should do it.
> ( I found the original code here:
> http://www.geeks3d.com/20090729/howto-perspective-projection-matrix-in-opengl/ )
>
> Now, a little embarrassing ... :-) I am with D for around 2 Weeks now, so ... how
> can I actually use your modules ?
> I am using VisualD, in the prefs I added the Path to the source code, but I am
> getting "cannot find symbol blah" when I build my project. Any idea why ? The d
> files are found, but what do I have to import ?
>
> Cheers, ParticlePeter
>
>
> begin 644 linalg_project.d
> M+R\@1F5E;"!F<F5E('1O('5S90T*#0IV;VED('!R;VIE8W0H(&9L;V%T(&9O
> M=BP@9FQO870@87-P96-T+"!F;&]A="!Z;F5A<BP@9FQO870@>F9A<B`I("![
> M#0H-"@EF;&]A="!025]/5D527S,V,"`](#`N,#`X-S(V-B`[#0H-"@EF;&]A
> M="!X>6UA>"`]('IN96%R("H@=&%N*"!F;W8@*B!025]/5D527S,V,"`I(#L-
> M"@EF;&]A="!Y;6EN(#T@+7AY;6%X.PT*"69L;V%T('AM:6X@/2`M>'EM87@[
> M#0H-"@EF;&]A="!W:61T:"`]('AY;6%X("T@>&UI;CL-"@EF;&]A="!H96EG
> M:'0@/2!X>6UA>"`M('EM:6X[#0H-"@EF;&]A="!D97!T:"`]('IF87(@+2!Z
> M;F5A<CL-"@EF;&]A="!Q(#T@+2AZ9F%R("L@>FYE87(I("\@9&5P=&@[#0H)
> M9FQO870@<6X@/2`M,B`J("AZ9F%R("H@>FYE87(I("\@9&5P=&@[#0H-"@EF
> M;&]A="!W(#T@,B`J('IN96%R("\@=VED=&@[#0H)=R`]('<@+R!A<W!E8W0[
> M#0H)9FQO870@:"`](#(@*B!Z;F5A<B`O(&AE:6=H=#L-"@T*"6UA=')I>%LP
> M75LP72`]('<[#0H);6%T<FEX6S!=6S%=(#T@,#L-"@EM871R:7A;,%U;,ET@
> M/2`P.PT*"6UA=')I>%LP75LS72`](#`[#0H-"@EM871R:7A;,5U;,%T@/2`P
> M.PT*"6UA=')I>%LQ75LQ72`](&@[#0H);6%T<FEX6S%=6S)=(#T@,#L-"@EM
> M871R:7A;,5U;,UT@/2`P.PT*#0H);6%T<FEX6S)=6S!=(#T@,#L-"@EM871R
> M:7A;,EU;,5T@/2`P.PT*"6UA=')I>%LR75LR72`]('$[#0H);6%T<FEX6S)=
> M6S-=(#T@+3$[#0H-"@EM871R:7A;,UU;,%T@/2`P.PT*"6UA=')I>%LS75LQ
> M72`](#`[#0H);6%T<FEX6S-=6S)=(#T@<6X[#0H);6%T<FEX6S-=6S-=(#T@
> ',#L-"@T*?0``
> `
> end
Hi

Great you like gl3n. For a projection-matrix use: mat4.perspective or if you want an orthographic: mat4.orthographic, unfortunatly ddoc ignores this block (I think because of "static if(isFloatingPoint!mt)", it begins here: https://bitbucket.org/dav1d/gl3n/src/affe3816c7a4/gl3n/linalg.d#cl-1080

I don't know VisualD but you've normally to add the path to the files (base dir, it is -Ipath/goes/here for dmd) and also each file, it could look like this:

-Igl3n/ gl3n/interpolate.d gl3n/linalg.d gl3n/math.d gl3n/util.d my_prog.d

and in my_prog.d you import the parts of gl3n as follows:

import gl3n.linalg; // if you want linear algebra, vectors, matrices and quats
import gl3n.math; // if you need math, normally you always do!
import gl3n.interpolate; // for interpolation functions
import gl3n.util; // to check for types

Hope this helps
- dav1d


December 05, 2011
Hi,

and sorry, I found the perspective method just right now :-)

Unfortunately this does not help, still having issues. I will ask on the VisualD
Forum.
Meanwhile, I just copied the files into my project dir, and there it works fine,
so I can play around :-)

Cheers, ParticlePeter
December 06, 2011
On 12/5/2011 10:49 PM, ParticlePeter wrote:
> Hi,
>
> and sorry, I found the perspective method just right now :-)
>
> Unfortunately this does not help, still having issues. I will ask on the VisualD
> Forum.
> Meanwhile, I just copied the files into my project dir, and there it works fine,
> so I can play around :-)
>
> Cheers, ParticlePeter

Your problem comes from misunderstanding what 'import' means. The import statement is important for the compilation stage. When module A imports module B, the compiler can know what types/functions/templates and so on are available for module A to use. But that's only half the story. You also need to make sure that module B is compiled and linked into the final executable.

In your case, you could compile gl3n as a library and link to it or, as you have discovered, add them to your project so that they are compiled along with your own source modules. Otherwise, you will get errors aout missing symbols.
1 2
Next ›   Last »