|
Is it possible to pick points/edges/faces with the OpenGL API given a set of 2D coords? I know you can pick an "object", but can pick the individual components of the object? If not, anyone know of a good library that supports this or pointers on how to accomplish it?
|
|
|
|
|
Sure. You can achieve the granularity you like by placement of 'names' - UINT identifiers. You can draw as much or as little as you like between calls to glLoadName ; if a rendered primitive is 'hit', it'll be identified by the name. No third party lib necessary - it's all built in. Check out Chap. 13 of the Red Book - 'Selection and Feedback'. (Well, it's Chap. 13 in the Third Ed., anyway. I think they're up to the 5th Ed. now.)
L u n a t i c F r i n g e
modified on Saturday, January 30, 2010 9:08 AM
|
|
|
|
|
Thanks, I'll try that out.
|
|
|
|
|
Hi ALL,
Whats the difference between Managed DirectX Apis and UnManaged DirectX Apis.Do they come with two different SDKs.One SDK as Managed DirectX SDK and as UnManaged DirectX SDK.
Thanking in advance,
Ashwath.
|
|
|
|
|
Managed DirectX is the variety that compiles with a NET Framework language, (C#),...you must have the NET Framework installed on the executing machine for it to work (and, yes, the SDK libraries that your program links to
are different). From my experience, the Managed DirectX API functions have the same functions available as the COM DirectX (C++) version, but the syntax when writing code is slightly different.
If you GOOGLE the two terms, you will find an enormous amount of information available (API Reference and tutorials).
MSDN DirectX Developer Center[^]
Also, if you had bothered to look around here at CodeProject, you would have found An Enormous Number of Excellent DirectX Articles[^]
|
|
|
|
|
To expand on the above response, I believe Managed DirectX is actually a managed wrapper around the COM API. I think you still need the unmanaged DirectX SDK installed to work with Managed DirectX.
One thing to keep in mind is Managed DirectX is no longer in active development, and only supports up to DirectX 9.0c. If you want to access any DirectX 10 or 11 features, I would suggest using SlimDX[^]. I think when you install the SlimDX SDK, it also installs the DirectX SDK components it uses, but I'm not sure.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
dybs wrote: One thing to keep in mind is Managed DirectX is no longer in active development, and only supports up to DirectX 9.0c. If you want to access any DirectX 10 or 11 features, I would suggest using SlimDX[^].
So what's a problem in using Unmanaged DX? Work without managed wrapping. And if you want to access to DX 10 features, not essentially to install SlimDX, in DX SDK including libraries and samples that are necessary for DX 10 features.
|
|
|
|
|
Hello,
How can i draw double dash line in gdi+ (preferably in c# ?)
It should look something like this -_-_-_-_-_ .
thanks,
berlus
|
|
|
|
|
I think you'll have to draw two lines each with the different style that are parallel to each other. You could build a class to encapsulate the details.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
When I did this, I used either a Line drawing algorith(draw by pixel),
or draw by overlapping lines...
for a double line:
g.Drawline(new Pen(7, black),pA,pB);
g.Drawline(new Pen(3, white),pA,pB);
results in a double line
if you want it to be dashed...
g.Drawline(new Pen(7, black),pA,pB);
g.Drawline(new Pen(7, white),pA,pB-1x);
g.Drawline(new Pen(7, black),pA,pB-2x);
g.Drawline(new Pen(7, white),pA,pB-3x);
g.Drawline(new Pen(7, black),pA,pB-4x);
g.Drawline(new Pen(3, white),pA,pB);
--O.k. I know it isn't "Real Code" but that should give you the idea...I'd blame it on the Brain farts.. But lets be honest, it really is more like a Methane factory between my ears some days then it is anything else...
|
|
|
|
|
Hi,
I use in my program GDI+, i.e. graphics::FillPolygon to draw an nonrectangular polygon with particular transparency. Tis works fine on screen and also to printers.
But now I need to export the results of my program to HPGL.
So far so good, I installed a HP driver, with interface to “file”.
The result is OK, but the filling isn’t OK at all. I see an rectangle over the min-max box of my polygon, filled with a solid color.
Is there anywhere a driver available, which can do that job?
If I check the driver’s option “use memory in computer” the result looks a little bit better, but all I get now is a big bitmap.
modified on Tuesday, January 5, 2010 9:51 AM
|
|
|
|
|
well, i´m working in an application for windows mobile 6.1 (personal use)using visual basic .net. but in this platform is very limited. so i can´t do many things as in the win32. but i seen from my phone (htc touch pro, windows mobile 6.1 phone edition) graphics, and innovations that i really want to put in my application.
as 1,2,3, pages of transparent background, animation, programs launcher style.
any help, to guide me in wich lenguage i have to learn, and wich technology to use as (opengl es, directx, gdi+).
thanks.
see ya
|
|
|
|
|
Hello,
Short version: What's the best way to capture a non-AVI video from a DirectX display in Windows Forms? I would prefer to use WMV or MPG since AVIs can get quite large. I've seen a lot of suggestions for DirectShow, but I hear it's not supported in Vista of 7. I need this to work in both XP and Vista. I'd rather use the same solution for each OS, but if necessary we can implement separate ones.
Not-so-short version: I have a Windows Forms app that uses Managed DirectX for a portion of the display, and the customer wants to be able to capture a video of it. We've tried saving the frames to BMPs and then using various utilities (Windows Media Encoder SDK, BMP2AVI cmd line util) to compile them into an AVI, but the process of saving the BMPs really slows down the framerate. Also, the frames are only about 500 x 600, and a 15-sec AVI is about 300 MB! The customer may want to record longer videos at higher resolution, so it would be nice to save to an MPG or WMV if we could. It would be even better if we could skip saving the frames to BMPs and create the video on the fly, but I assume that would be even worse performance.
Thanks,
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
modified on Friday, December 25, 2009 12:19 PM
|
|
|
|
|
AVI is just a container format, you can still compress them (as, for example, H.264)
|
|
|
|
|
I've used ScreenRecorder Pro[^] for this sort of thing in the past - maybe it'll do what you need.
L u n a t i c F r i n g e
|
|
|
|
|
Thanks for the link. However, our customer wants the recording functionality built into our app, not as a separate utility he must purchase. If we could add a reference to ScreenRecorder Pro in our project and integrate it that way, then this would be perfect.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Hmmm... I don't think it supports automation, but you could check with the authors.
L u n a t i c F r i n g e
|
|
|
|
|
FWIW: I bookmarked this[^] but never used any.
|
|
|
|
|
Luc,
Thanks for the link. A colleague of mine has actually been writing the code, I haven't seen too much of it. I know he's tried captureing the DirectX frames as BMps, then using Windows Media Encoder to merge them into a WMV, but the frame rate has never been quite right. He might not have seen the IWMEncVideoSource2 type, which looks like exactly what we need. Hopefully the performance will be decent on it.
Thanks,
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
I have a set of products that were written in C++ and use GDI+ to render the graphics. This approach works well enough on my 7 year old P4 running Windows XP, i.e. the graphics are rendered quickly without any problems. But now some of my customers are moving to Windows 7. They are experiencing tremendous lags in graphics rendering with my software.
Could someone clue me in as to some possible reasons this is happening? I'm puzzled as to why my old computer is actually faster at rendering graphics with GDI+ than a newer computer running Windows 7.
|
|
|
|
|
A out of date graphics driver for the Win 7 machine can cause software rendering to kick in and thus be much slower.
|
|
|
|
|
Check out this link...
http://blogs.msdn.com/directx/archive/2009/09/29/comparing-direct2d-and-gdi.aspx[^]
Specifically.. the first reader comment:
"For whatever reason GDI+ slows so down in Windows 7, it is not understandable....
Reply:
"Husker, the problem with GDI+ that you describe is related to new support for device bitmaps in Win7, and there's a workaround.
In Vista, Microsoft stopped using XP Driver Model (XPDM) display drivers in scenarios in which the Desktop Window Manager (DWM) is running. Because of this, it meant that all GDI operations – which used to be hardware accelerated by XPDM drivers – became software-only (meaning, not hardware accelerated). Applications render via GDI to a software buffer, which is then blt’d via the DWM.
In Windows 7, Microsoft modified the use of GDI in a couple important ways. First, the GDI back buffer maintained by DWM was moved from system memory into hardware aperature memory. This improves blt speed. Second, WDDM 1.1 drivers can hardware-accelerate a certain number of limited GDI operations (eg. solid color fill, etc). So, as long as you have a WDDM 1.1 driver, GDI is sort-of “reaccelerated”. The degree to which WDDM 1.1 cards can hardware accelerate depends on fill rate, etc.
There’s a bug in GDI+ (which you’re describing above) that causes it to do readback from the hardware in a certain number of scenarios. The best way to use GDI+ in Windows 7 is to render with GDI+ to a DIB section and then blt the final result. You might want to give that a try before doing anything else.
Tom
|
|
|
|
|
Also this article has some insights on the W7 and GDI/GDI+/2D rendering.
|
|
|
|
|
Hello there,
I have following four column data with me..
Latitude, Longitude, U (velocity along x) and V (velocity along y)
Now using these data, I got to display vector plots where the velocities u and v are shown using arrows..
I am able to get the magnitude to be displayed... Now the problem is that i am not able to show the direction.. ( direction in terms of arrow) In other words how do i display an arrow at the head part of that vector.??
Second thing is that i have another set of data
Latitude, Longitude, and Depth..
Using these data, i need to display line contours.. Any slight initiation to solve this problem will be grateful...
Thanks in advance
|
|
|
|
|
One thing at a time. Let's look at the vectors first.
Each vector arrow will consist of two elements - a line and an arrowhead. The length of the line should be related to the magnitude of the vector, and it should be rotated to match the angle implied by the two cartesian components (U and V). The lines should probably be scaled so that the longest one stretches completely across it's 'cell' in the vector field, without reaching into adjoining cells.
The arrowhead is a little trickier. You need to work out the dimensions for the basic triangular shape you'll want, with it pointing, for instance, stright up. The shape will be defined by the locations of the three corners, relative to the center of the arrowhead. Then modify your arrowhead code so it'll take an angle as a parameter, and will render the arrowhead rotated to that angle. (Hint- if you define the arrowhead by it's corners, you should be able to apply the rotation to the corners and then draw the triangle.
That should get you started, anyway.
|
|
|
|
|