I am rendering an image using directx 11. The objective is to select pixels from this image and then move it around with mouse. The selection can be of any geometry, like bezier, rectangle etc.
I am new to directx, could someone please suggest a way to achieve this?
Thanks.
Related
I am upgrading open layers library from 2.13 to 3.7. I am able to draw rectangle or circle but not able to modify them. It is taking rectangle as polygon and when resizing, going out of boundaries.
For circle, couldn't find any option. Please help.
ol.interaction.Modify does not currently support ol.geom.Circle geometries. You would have to write your own interaction, or contribute to the ol3 project.
I am writing a small game (it is 2d) in IOS using Opengl as a way to get comfortable with opengl. I am using the Texture2D class from the CrashLanding demo. I am using this to generate text for the score. When the text is drawn it is upside down. In the code there is comments about the texture being loaded upside down but I can not find a way to render it the correct way. Any help would be greatly appreciated.
OpenGL and your image loading code do not agree on where the origin is. OpenGL starts in the lower left hand corner, while your picture starts in the upper right hand corner. You can apply a transform to the picture in your app like the CrashLanding demo does. Or even simpler pre flip the image in an editing program such as Photoshop. This will work if your image will only be used as an OpenGL texture in this app. If you need to display this same picture elsewhere you'll need to keep a non flipped version, or figure out how to apply the transform.
I am building a 3D image viewer which has Three.JS plane geometries as placeholders with the images as their textures.
Now I want to add a black border around the image. The only way I have found yet to implement this is to add a new black plane geometry behind the image to be displayed. But this required whole-sale changes to my framework which I want to avoid.
WebGL's texture loading function gl.texImage2D has a parameter for border. But I couldn't find this exposed anywhere through Three.js and doubt that it even works the way I think it does.
Is there an easier way to add borders around textures?
You can use a temporary regular 2D canvas to render your image and apply any kind of editing/effects there, like paint borders and such. Then use that canvas image as a texture. Might be a bit of work, but you will gain a lot of flexibility styling your borders and other stuff.
I'm not near my dev machine and won't be for a couple of days, so I can't look up an example of my own. This issue contains some code to get you started: https://github.com/mrdoob/three.js/issues/868
Im working on a painting app which has a tool to brush similar to a painting brush. I've implemented so far through cocos2d, a format like the image
. But my client wants clear edged texture as the image Also the color of the former image is some what blurring indeed. How I can reduce blurring of the sprite image? The image I am using as a texture is the image. Im using a code derived from the Cocos2d RenderTextureTest.
Also, the blend function Im using like in the below code
[brush setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE}];
[brush.texture setAliasTexParameters];
where, brush is my sprite with the above mentioned texture.
Is there any other way to get the sharp edges as in the later image? Or how I can make the image stop blurring? I am struggling it for last few months. Please some experts look into this and help me.
I'm looking for ideas on how to draw a skinnable "button" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes skinning difficult. Another option is to break the button into 9 smaller images (3x3) and stretch them all -- kindof like rounded corners are done in HTML.
Is there another "easier" way? What's the best approach?
If you really want to accomplish this, the way to do it is with texture coordinates. Much like you would make a stretchable button/panel design in HTML with a table, you simply define the UV coordinates for the corners, the top stretchable area, the bottom stretchable area, the side stretchable areas, and then the middle.
For an example of this being implemented in an XNA engine (though it's a closed source engine), see this:
http://www.flatredball.com/frb/docs/index.php?title=SpriteFrame_Tutorial
Yes. I am working on an Editor. It's a XAML-like language (or OpenLaszlo-like, if you prefer) for XNA. So the buttons can be resized by the editor. The buttons might also be resized by a style sheet.
I guess you're right that it's likely that the buttons will all be the same size in a real design. But even in a window's app, you sometimes need to make a button wider to accomodate text.
It should be possible with shaders. You would probably have to do texel lookups, but it would cut down on the number of triangles in a complex UI.