textures

How can I use ARGB color in opengl/SDL?

岁酱吖の 提交于 2019-12-01 05:20:49
I am rendering SVG using Cairo. The Cairo output format is ARGB. Then I put rendered image in a SDL_Surface so I can use it as a openGL texture. The rendered image was looking just fine when I use directly the SDL_Surface. But I had to use the surface as a texture in openGL because I needed some openGL function. The problem is, that all the color are flipped. OpenGL use RGBA and not ARGB. I was wondering if anybody could help me converting a SDL_Surface ARGB to RGBA. Usefull information: I used this tutorial to render my SVG. http://tuxpaint.org/presentations/sdl_svg_svgopen2009_kendrick.pdf

Texture recognition within a specific area in the pic

*爱你&永不变心* 提交于 2019-12-01 05:18:55
问题 I'm new in the texture recognition field, and I would like to know which are the possible ways to approach a texture problem in opencv. I need to identify the texture within a region in the pic, and tell if it is uniform, homogeneous in the whole area, or not. More in depth, I need to be able to tell if a possible fallen person is a person (with many different kind of textures) or something wrong like a pillow, or a blanket. Could anyone suggest a solution, please? Is there some already made

How can I use ARGB color in opengl/SDL?

北城以北 提交于 2019-12-01 05:01:33
问题 I am rendering SVG using Cairo. The Cairo output format is ARGB. Then I put rendered image in a SDL_Surface so I can use it as a openGL texture. The rendered image was looking just fine when I use directly the SDL_Surface. But I had to use the surface as a texture in openGL because I needed some openGL function. The problem is, that all the color are flipped. OpenGL use RGBA and not ARGB. I was wondering if anybody could help me converting a SDL_Surface ARGB to RGBA. Usefull information: I

libgdx texture filters and mipmap

荒凉一梦 提交于 2019-12-01 03:59:38
When I try to use mipmap filtering in LibGDX, none of the images appear. I'm new to LibGDX, and I have a simple 2d scene with three rotating, scaled circles. In order to anti-alias them, I wanted to use linear filtering. For advice, I looked to this article ,which said that, for heavily scaled images, a mipmap can be used to improve speed or quality. The first unexpected appearance was that, despite the fact that all of my images were scaled down, I would only see a linear filter if the magFilter was linear. In other words: This code will show a linear filter for minified images: parentTexture

Changing texture and color on Three.js collada object

与世无争的帅哥 提交于 2019-12-01 03:59:07
I recently got three.js example from the official site working with my collada objects (.dae) using the ColladaLoader.js . Now my question is, how do i change the loaded collada object color attribute and add a custom texture?? I tried adding the texture with no luck yet. Here is my code (slightly changed from the original example): function load_model(el) { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; var camera, scene, renderer, objects; var particleLight, pointLight; var dae, skin; var loader = new THREE.ColladaLoader(); loader.options.convertUpAxis = true;

glColor coloring all textures

依然范特西╮ 提交于 2019-12-01 02:54:18
问题 I'm fairly new to OpenGL so maybe the answer will be obvious. I am currently trying to make a blue circle using GL_TRIANGLE_FAN in C++. My problem is that when I set the color using glColor4f, it sets all my other textures to have a blue color over them such as shown below (this is supposed to be silvery metal). I draw the textures using the method shown below. glLoadIdentity(); glTranslatef(x,y,0); glBindTexture(GL_TEXTURE_2D, this->texture); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f);

Export a three js textured model to a .OBJ with .MTL file

左心房为你撑大大i 提交于 2019-12-01 01:19:52
问题 I would like to be able to export an obj file just like in this example http://threejs.org/examples/#webgl_exporter_obj However, i would like to export the .obj file with corresponding textures in the .mtl texture file (i have seen obj files with "usemtl someTextureNameFromMTL") I have seen this question but the exporter seems to be exporting only mesh. I have also found this question but that discusses importer only. The thing i wanted to implement is to make a 3d printable editor that would

Changing texture and color on Three.js collada object

☆樱花仙子☆ 提交于 2019-11-30 23:57:28
问题 I recently got three.js example from the official site working with my collada objects (.dae) using the ColladaLoader.js . Now my question is, how do i change the loaded collada object color attribute and add a custom texture?? I tried adding the texture with no luck yet. Here is my code (slightly changed from the original example): function load_model(el) { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; var camera, scene, renderer, objects; var particleLight,

android textured text

耗尽温柔 提交于 2019-11-30 21:54:15
How can I make a text with texture instead of text color or gradient(for example png file)? Something like this . I understand the logic, that I should make text color transparency and put under the text bitmap. I think I can't achive this with a Textview . And I don't know how to do it with a canvas or OpenGL. Any ideas please? Here's a way of doing it using PorterDuffXfermode . public class MainActivity extends Activity { private EditText mEditText; private ImageView mImageView; private Bitmap mTexture; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

glTexImage2D Segfault related to width/height

↘锁芯ラ 提交于 2019-11-30 20:37:09
I got a segfault when I tried to load a 771x768 image. Tried with a 24x24 and 768x768 image and they worked, no problem. Is this expected? Why wouldn't it just fail gracefully with a GL Error? The segmentation fault occurs in the glTexImage2D call. I am loading a PPM binary file so it is packed 24 bits per pixel. This odd number combined with an odd dimension probably produces a not-4-byte (or even 2-byte) aligned structure (and referencing outside of my exactly enough allocated buffer may be the cause of the error but gdb does not show me a memory address (which I could use to find out if