|
Open Design Alliance[^] offers a full DWG API. It's free so long as you are using it internally. There are significant costs if you want to license it to include in a product you plan to sell.
Cheers,
Drew.
|
|
|
|
|
Hi, i am writing an app that copies the screen, warps/distorts the image, then draws it back. I already got the code working in a visualization i am making for Windows Media Player but for some reason it won't work now.
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
enableBlend();
glColor4f(1.0f, 1.0f, 1.0f, 0.9f);
renderBackground(wf);
enableTexture(image);
glBegin(GL_QUADS);
glTexCoord2f(0, 1); glVertex2f(0, 0);
glTexCoord2f(0, 0); glVertex2f(0, 512);
glTexCoord2f(1, 0); glVertex2f(512, 512);
glTexCoord2f(1, 1); glVertex2f(512, 0);
glEnd();
glBindTexture(GL_TEXTURE_2D, backTexture);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 512, 512, 0);
disableTexture();
disableBlend();
That's basically it, renderBackground() draws the texture over a grid of warp points which is stored in a WarpFile object. The enable/disable methods are just wrappers for the OpenGL commands. Is there anything i am doing wrong? I tried pbuffers do copy/render to but it was too hard.
If you need me to post more code (like the renderBackground method) just ask
thanks
--------------------------------
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
|
VizCoder wrote: That one bug has really been p...
You should consider switching to a modern programming language ...
|
|
|
|
|
Get in the habit of doing this:
if (BG_WARP == bgType)
That won't compile with the single =
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I wanna change Hue of image how can i do ??
Using ColorMatrix or using manual loop Lockbits(),Unlockbits..
Please help Urgent.
I tried to see QColorMatrix but its little complicated..
i am already doing lot of processing on image using color matrix as well as looping(lockbits and unlockbits.) also.
Also i waana know how can i control blur ?? if i Apply blur filter it does blur little if i waanna blur more do i have to apply blur filter again and again on the blurre image???
Is there way to control blurr using some factor in only one filter??
|
|
|
|
|
How can I highlight a specific part of an Image in a PictureBox or an Image on a Label in C#.NET.
|
|
|
|
|
I'm trying to turn my PPM (lossless image file) into a texture, but the texture is not showing up correctly. I've tried loading a bitmap image as a texture using glaux and a call to auxDIBImageLoad(), however, I would simply like to implement my own parser for PPM. Basically, in PPM, the line after the getting the value for "int maxValue" is a long line of binary data that stores the 8-bit RGB (total 24 bits) going from left to right, top to bottom in the image. If we think about this in a 2D coordinate system, parsing the file would first get you (x, y) = (0, 0), then (1, 0), then (2, 0), until the end of the width, then (0, 1), and etc.
Knowing this, does anyone know why my texture is being parsed incorrectly?
ifstream texFile("brickbump.ppm");
if (texFile.is_open())
{
char propBuf[8];
texFile.getline(propBuf, 8);
string format = propBuf;
texFile.getline(propBuf, 8);
int x = atoi(propBuf);
texFile.getline(propBuf, 8);
int y = atoi(propBuf);
texFile.getline(propBuf, 8);
int maxValue = atoi(propBuf);
char* texArray = new char[3 * x * y];
int count = 0;
while (!texFile.eof())
{
texFile.get(texArray[count]);
count++;
}
glGenTextures(1, &m_textures[0]);
glBindTexture(GL_TEXTURE_2D, m_textures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, x, y, 0, GL_RGB, GL_UNSIGNED_BYTE, texArray);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
delete [] texArray;
}
|
|
|
|
|
I am allowing users to resize images dynamically using CRectTracker .
What i observed is while resizing using mouse sometimes images appears blurred and if i further resize again it becomes good this keeps on happening.
I have set Interpolation mode to InterpolationmodeHighQualityBicubic.
What can be the reason for image to appear blurred.??
i am little confused with this as everytime it follows same code flow.
and every time i am using one original image for resizing(the resized image is not used for further resizing.)
Some hellp or some hints would be highly appreciated.
Thanks,
Sandip.
|
|
|
|
|
What is CRectTracker ?
The blurring is what a bicubic filter does, it blends values from imaginary subpixels, so as not to create a harsher effect by simply rounding the values.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes but why it is different always?
I mean i draw image once it is acceptable
Second time i resize litle it becomes blurred than first
Third time i further resize again it becomes acceptable.
For each resize i am using original image so there cant be effect of previous resize operation.
??
Thanks,
Sandip.
|
|
|
|
|
How can I understand the GPU Gems 2?
I feel I cannot understand any part of it!!
Are there any knowledge I must know?
|
|
|
|
|
How about basic 3D math, modern techniques for modeling, meshes, lighting, testuring, rendering, how a GPU works, maybe some OpenGl, but definitely DirectX, ... These books are NOT for beginners. They're cookbooks for developers and graphics artists who have experience in 3D graphics, modelling, rendering, ...
|
|
|
|
|
If you are starting in graphics programming start with something like the OpenGL Superbible or a tutorial on 3D graphics. GPU gems I, II, and soon III are as was mentioned, cook-book recipes for advanced 3D chefs. I have used my two copies often and get a lot out of them. But you have to be in the need of something beyond what all the beginning graphics books give you. Even Graphics Gems series I would classify in the medium to advanced depending on category, but they are less advanced than the GPU Gems.
GPU Gems series assumes you have mastered 3D graphics programming on the PC and need only techniques of utilizing graphics on the GPU only. So you would need to know just about everything about graphics programming except techniques on the GPU. Even then it assumes you already know how to get the programming onto the GPU and interface with the CPU in a co-rendering cycle, that is a big assumption.
Stay away from any of the Gems series, until you have mastered all the beginning level books. When the tutorials and superbible leave you dry and begging for more, grab the Graphics Gems or Game programming Gems. When those two leave you dry and you are begging for more speed and capability out of a multi-pipe (and thus parallel) GPU to assist in the process, then and only then grab the GPU Gems series.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I'm relatively new to GDI+. I'm trying to create a texture brush from a bitmap stored in a resource file in a Visual C++ project. However, the image comes out much too small when I fill a shape with the texture brush.
The bitmap I'm using is 32x32 and is monochrome.
Bitmap bmpPattern(AfxGetResourceHandle(), (WCHAR*)lpszBmpName);<br />
TextureBrush *pBrush = new TextureBrush(&bmpPattern);
If I want to see the image as it's drawn when using GDI's CreateDIBPatternBrushPt, I have to do a scale tranform on the texture brush by about 10 times.
I'm not sure what's causing this, but I'm guessing it's something to do with the page units. Any clues? Thanks in advance!
|
|
|
|
|
Are you using GDI+ or GDI to draw a filled shape.
Taking from your GDI+ code, I did this in a CWnd-derived OnPaint()...
// IDB_BITMAP4 is a 32x32 monochrome bitmap resource, black 2-pixel-wide border filled with
// dithered pixels (from a color in the monochrome bitmap editor palette).
Graphics DstGraphics(*this);
Bitmap brushbitmap(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP4));
TextureBrush texturebrush(&brushbitmap, WrapModeTile);
Rect ellipserect(0, 0, 640, 640);
DstGraphics.FillEllipse(&texturebrush, ellipserect);
The bitmap is drawn full size in the ellipse. Do you get the same result?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
No, mine is displayed at about 1/10th the size it should be.
I thought that my problem might be that the bitmap was created from a resource file bitmap. So, I tested just creating a bitmap by doing this:
Bitmap bmpTest(32, 32, PixelFormat32bppARGB);<br />
BitmapData bitmapData;<br />
bmpTest.LockBits(&Rect(0, 0, 32, 32),<br />
ImageLockModeRead | ImageLockModeWrite,<br />
PixelFormat32bppARGB,<br />
&bitmapData);<br />
UINT* pixels = (UINT*)bitmapData.Scan0;<br />
<br />
for(UINT row = 0; row < 32; ++row)<br />
for(UINT col = 0; col < 32; ++col)<br />
pixels[row * bitmapData.Stride / 4 + col] = (row == 0 || row == 31 || col == 0 || col == 31) ? 0xFF000000 : 0xFFFFFFFF;<br />
<br />
bmpTest.UnlockBits(&bitmapData);<br />
TextureBrush *pBrush = new TextureBrush(&bmpTest);
But it still displays much too small. I'm thinking maybe it's a problem of page units, but if that's the case, then why do all my ellipses and rectangles show up in the right place, just with their texture-filled insides too small?
|
|
|
|
|
Your code works for me too. I'm not sure what page units you're referring to, but the problem
seems to be in the Graphics object you're drawing to (i haven't seen ay code showing your
Graphics object creation and drawing ).
Maybe try this...
Right before you draw, call DstGraphics.ResetTransform();
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Ah, very true! I create my graphics object from a handle to a CDC that gets passed down from an OnPaint's CPaintDC.
I tried the reset transform on the graphics object, but no luck. By page units, I mean the SetPageUnit method of the Graphics class.
|
|
|
|
|
If you're using SetPageUnit() then maybe this will be of interest:
Types of Coordinate Systems[^]
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi to All!
I have a problem to catch event from button on webcam using DirectX or WIA.
Any ideas.
|
|
|
|
|
I am thinking of enhancing the 3D display of the scene in my app. Currently I'm using a simple method with OpenGL.
The idea is displaying a scene with a LOT of objects, but there is no need for complex rendering (I mean: no need for extreme realism). I want to be able to change viewpoint, zoom, etc., but it's not a game, so no need for maximum speed.
What are my options ? OpenGL, DirectX ? Maybe WPF ?
Things to consider ?
Thanks in advance.
|
|
|
|
|
BusyDeveloper wrote: Things to consider ?
if your focus is on the "scene" of objects, not on the objects themselves, you might change focus a bit towards a scene-graph. This is not a replacement of OpenGL or DirectX, it is a higher level operation that is simply an organization construct. Objects are placed on the scene-graph and the scene-graph is then rendered via OpenGL or DirectX. There are many scene-graphs available, but if you are using OpenGL already, OpenSceneGraph might be easiest to switch to.
http://www.openscenegraph.com/index.php[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Dear All
Regards!
I am using OpenGL(CSGL) in C#, i draw a line and now want to zoomin and zoomout it in OpenGL, kindly help me while developing program for Zooming in openGL.
Regards
David
david
|
|
|
|
|
How can i change alpha channel values without rinning Height*width loop
Is there any way that i can drawimage without altering alpha values of background??.
i mean i have two images where bye sequences of pixels will be as follows
22 0
34 0
56 0
255 14
55 0
22 0
44 0
255 10
23 0
37 0
56 0
255 14
51 0
28 0
44 0
255 10
now i want to replace 255 with other values or Replace 0's with values from first column.
|
|
|
|
|