Beginner-questions
BlitzMax Forums/OpenGL Module/Beginner-questions
| ||
Ok, i editted my post here. I got some things working, even though i don't exactly know why certain things occur as they do. I'm just moving along, hoping i'll find them out later on. Anyway: i'm trying to figure out how to have my quads get opacity. i read tutorials, examples but can't find out why i don't get any results in that direction. i used glEnable(GL_BLEND) glColor4f(1.0,0,0,0.21) glBlendFunc (GL_SRC_ALPHA, L_ONE_MINUS_SRC_ALPHA) Is there more i should take care of before any alpha on my quads will work? (apologies for the bad title - can't seem to fix that anymore) |
| ||
You can't call GLBlendFunc inside a GLBegin...GLEnd block. Move it above GLBegin and it works. |
| ||
thank you, that works indeed. my alpha-values have some effect now, although i'm not getting the results i wanted. how would i get a cube that you can see through slightly? i get a 1-color-solid version of the cube, but expected for example to be able to see faces at the rear of the cube (by looking through the front ones). |
| ||
Alpha ranges from zero to 1. Keep in mind two of the faces (at least) will overlap and make the cube seem less transparent. Try drawing a busy background behind it. |
| ||
I'd like to be able to use this for zooming in my project. But I have a bit of difficulty understanding certain things for opengl. if I set my graphics with GLGraphics, it returns null object for the first image it tries to load. Setting it back is fine. If i use this code as is and I load and draw an image in it, it returns null object when I run it, if i change glgraphics to graphics it works and it draws a black screen with my image only. ive set my graphics driver to opengl in my project, why won't this stuff work with graphics. and why when i use GLgraphics in my app does it not work. can this work to tanslate the z of normal drawn images in max? or in tanslatef on the z coordinate only works because he is using opengl cubes... and i think someone said somewhere that max images are quads, so they should be able to go in and out of the screen right? gltanslatef is what i need, but i have no idea how to implement it, in the function i use in my project i call all the right things like the glprojection, glmodelview, glloadidentity, but my graphics just flicks right off the screen when i zoom. |
| ||
You can use glColor4ub if you want to use values 0..255 without having to think what it is as a decimal of 1 |
| ||
that solves the problem i spoke of? :) |