Tag Info

Hot answers tagged

3

I'm not finding any way to do this within the cocos2d framework, so if someone can do that it would probably be a better answer. However, cc.Texture2D does have a getHtmlElementObj() function. Now, this function can return either an image element or a canvas element. If it returns an image, you need to make a canvas from it as shown in this answer: var ...


3

glRotatef(GLfloat angle, Glfloat x, GLfloat y, GLfloat z); The Above function is what you need for your purpose. It " multiplies the current matrix by a rotation matrix", as the OpenGL documentation says. Here's how you use it- angle is the angle you want to rotate. (Duh.) The next three parameters define the axis around which you would like to rotate. You ...


3

The only apparent error in your code is that you seem to specifying 4 mip-levels, from level 0 to level 3, however, you set GL_TEXTURE_MAX_LEVEL to 4. The max level is the zero-based index of the last mip-level, so in this case, it should be 3: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3);


2

If you modify a material, it affects the objects that are using it. You need to duplicate that material, modify its texture and reassign it to the target object.


2

SDL2 doesn't need any functionality to be added for either of those items. Texture batching You yourself can sort the sprites by texture used. The SDL backends can already do draw call batching if they wish to (nothing requires that the Copy command be executed immediately; the only requirement is that it be executed by the time any side effects are ...


2

SharpDX is a DirectX wrapper, not an XNA one. XNA's GetData methods are higher-level abstractions on top of the underlying DirectX functionality. If you're using the D3D9 interface, you probably want a variant of LockRectangle. If you're using D3D11 you probably want some variant of MapSubresource (or the similar method for D3D10). Note that in D3D9 the ...


1

Yes, this is a fine approach - it will be orders of magnitude faster than creating a primitive per data point. Assuming single-channel data, you should use whatever DXGI_FORMAT (or equivalent in OGL) maps to your source data, and convert in the pixel shader. There are native types for 8, 16, and 32-bit integers, as well as 32-bit floats. You should also ...


1

Given the documentation, it would seem that is the expected output. BC1 represents the data before compression as 5 bits red, 6 bits green, 5 bits blue, and 0 or 1 bits alpha, for 16 or 17 bits per pixel. BC4 represents it as one 8-bit channel, for 8 bits per pixel. However, then it compresses it. I'm not sure how exactly the compression works, but if you ...


1

As I understand from your question is that you to rotate the actual textures and not the polygon vertices. This can be done by modifying the Texture Matrix not the ModelView Matrix.(you're using fixed pipeline). In order to modify the texture matrix that actually transforms the UVs you need to enable it first. glMatrixMode(GL_TEXTURE); glLoadIdentity(); ...


1

Use an opacity map! Simply trace the outline of the eye in Photoshop, and make the "visible" part of the texture white, and the part you want invisible black. Then inside 3DS Max, go to your texture's mapping channels and insert the black and white image into "Opacity Map"—and voila! No more silly whiteness. P.S. The reason the black space shows up as ...



Only top voted, non community-wiki answers of a minimum length are eligible