Comments (3)
I don't understand your question. You want to import vec3
? import gl3n.linalg : vec3
from gl3n.
I want to compile an example program. I was expecting a module called 'import gl3n.all' or some thing.
I tried including all the modules (not counting the ext ones) and got this:
Joels-MacBook-Pro:gl3n joelcnz$ dub
Performing "debug" build using dmd for x86_64.
gl3n 1.3.1: target for configuration "library" is up to date.
game ~master: building configuration "application"...
source/app.d(19,2): Error: undefined identifier 'glUniformMatrix4fv'
source/app.d(23,2): Error: undefined identifier 'glGetDoublev'
source/app.d(25,18): Error: undefined identifier 'view'
source/app.d(26,23): Error: undefined identifier 'view'
source/app.d(26,2): Error: declaration app.main.inv_view is already defined
dmd failed with exit code 1.
Joels-MacBook-Pro:gl3n joelcnz$
Here's the code:
import gl3n.linalg;
import gl3n.linalg : PI;
import gl3n.math;
import gl3n.aabb;
import gl3n.frustum;
import gl3n.interpolate;
import gl3n.plane;
import gl3n.util;
void main() {
vec4 v4 = vec4(1.0f, vec3(2.0f, 3.0f, 4.0f));
vec4 v4_2 = vec4(1.0f, vec4(1.0f, 2.0f, 3.0f, 4.0f).xyz); // "dynamic" swizzling with opDispatch
vec4 v4_3 = v4_2.xxyz; // opDispatch returns a static array which you can pass directly to the ctor of a vector!
//vec3 v3 = my_3dvec.rgb;
vec3 foo = v4.xyzzzwzyyxw.xyz; // not useful but possible!
mat4 m4fv = mat4.translation(-0.5f, -0.54f, 0.42f).rotatex(PI).rotatez(PI/2);
glUniformMatrix4fv(location, 1, GL_TRUE, m4fv.value_ptr); // yes they are row major!
alias Matrix!(double, 4, 4) mat4d;
mat4d projection;
glGetDoublev(GL_PROJECTION_MATRIX, projection.value_ptr);
mat3 inv_view = view.rotation;
mat3 inv_view = mat3(view);
mat4 m4 = mat4(vec4(1.0f, 2.0f, 3.0f, 4.0f), 5.0f, 6.0f, 7.0f, 8.0f, vec4(1,2,3,4), vec4(1,2,3,4));
}
from gl3n.
Importing everything is a code smell that's why there is no gl3n.all
module. Furthermore compiling this example doesn't really makes sense, it is just a short overview of what is possible and how you would use it (e.g. glUniformMatrix4fv
is an OpenGL function which has per se nothing to do with gl3n).
from gl3n.
Related Issues (20)
- travis does not run unittests HOT 1
- Broke in dmd 2.068.0 HOT 5
- column major layout for matrices ? HOT 1
- Transposed matrixes not supported on every system HOT 2
- TypeTuple not found HOT 1
- 'TypeTuple' not found and other stuff HOT 1
- Matrix decomposition HOT 1
- core.simd and gl3n HOT 14
- Project Status HOT 2
- AABBT!int doesn't work HOT 1
- No documentation on Matrix.perspective HOT 1
- Matrix Translate resulting in different values from glm HOT 2
- Vector can not be used as AA-key
- Casting between Vector's with different types but the same length does not work HOT 3
- N-dimension AABB HOT 1
- When vecN is used with tuples, 'dub test' fails.
- Deprecation warnings HOT 1
- [proposal] adding a member function to_axisAngle() in struct Quat HOT 1
- Quaternion inverse is not the same as conjugate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gl3n.