|
Miss_ Petrovna wrote: how can i read 3 DIM vectors valuse of (static type) from file
how are the vectors defined... generally I have a vector < some3dstructure > storage. and then I simply read into some3dstructure and then push_back(some3dstructure) into the vector. This makes it real easy to read/write binary data. Text data is not really a little more difficult, but rather just a few more steps to keep track of and get right.
-- modified at 18:22 Monday 23rd July, 2007
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thankx El Corazon for Ur perfect opinion. i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly (this what i did in my program).Ur opinion is very nice from phelosophical view too .
regards
maria
-- modified at 5:51 Friday 27th July, 2007
|
|
|
|
|
Miss_ Petrovna wrote: i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly
they are not that much different. A routine for processing the vector information can in its simplest form be binary read/write. With minor changes you can use routines to provide an interface to/from the binary form to XML, or other text formats, or any format for that matter. They all have generally the same inforamtion, they simply put it in different forms or locations within the file.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
thank U again El Corazon for UR rich information about my question.. frankly, i'll avoid the complexity and errors which may be accured when data r read from file. both of UR opinions are satisfactory and perfect.. I have built my program upon UR first opinion, i'll keep UR second perfect suggestion for future work .
regards
maria
-- modified at 14:42 Sunday 29th July, 2007
|
|
|
|
|
I created a charting control for work in ASP.NET, and so far, they are thrilled. It has a bar chart, and a pie chart. Now they want a line chart (like a vertical bar). I have it working, but now they want each bar to look 3D.
Each item is passed into a collection on the control. An item consists of a color and amount. The chart is built by the percentage of each item in the total of all items.
Now they want the line chart (vertical bar) to have a 3D feel. I was able to get the 3D look, but I'm having a problem determining the values for the lighter and darker parts of each item. I need to figure out a lighter (and a darker) color for the passed value.
For example, the bar color would be red. For the shadowed part of the bar, I need a darker red. For the top of the bar, I need a lighter color. But since each item color is being passed, I need to determine these colors on the fly.
Something like GetDarkerColor(PassedColor) would be great. I just don't know how to determine these values.
Any help would be greatly appreciated.
|
|
|
|
|
Hi,
you could convert to HSB (hue, saturation, brightness) using Color.GetXXX() methods,
adjust brightness a bit, (watch out for over/underflow)
and convert back. You need to write that part yourself !
This article[^] is my preferred article for june and may help you.
BTW in the Java world GetLighter() and GetDarker() (or something of that nature) do exist.
|
|
|
|
|
hey...
need help in 2D drawing ...I want to add drawing ablity for elliptical curves, arcs and ellipses...most of the tutorials i have seen just draw static curves..
I want the drawings to be based on points specified by the user(through mouse clicks) but I having a little trouble in drawing circular arcs using three points(like in AutoCAD)...
any help will be appreciated
thanks
|
|
|
|
|
hello guys.
Im not a graphics person but I need help with something.I need a man, preferebly South African with all the states.I want to be able to click on the individual states and get to another picture.Im designing a web page for my company and I have subsidiaries in different states.I want info of those subsidiaries when I click, which I can display on the page.How do I get a map like that.ive googled and don get anything.
kagiso
|
|
|
|
|
Create a second bitmap with the same dimensions which you don't display. Give each unique area a unique color.
The next step is, when the user clicks your bitmap get the mouse coordinates relative to your bitmap and use these coords on your internal map.
DWORD ID = GetPixel( x, y );
switch ( ID )
{
case 12: //South African;
}
|
|
|
|
|
Can any one provide me links or docs for perspective image transform
i wanna implement perspective transform on images.
I had look at AGG but its so much complicated to undersrand the actual logic due to templates.
Pleasae some guidnace will highly appreciated..
Please urgent..
Thanks,
Sandip.
|
|
|
|
|
SandipG wrote: Can any one provide me links or docs for perspective image transform
i wanna implement perspective transform on images.
http://en.wikipedia.org/wiki/3D_projection[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
www.geocities.com/eyalzach/tdt.zip
good luck
|
|
|
|
|
hi people!
can anyone tell me how to copy to a bitmap what's under my window? I was trying to get full aero effect in XP, bluring, light aura ect. got OK, but I can't get waht to blur
P.S. Sorry for my horryble English...
|
|
|
|
|
The best way i can suggest is to grab a screenshot of the entire desktop and then grab the area around your window which can be done by using the top, left, width and height properies of the form.
Here is a link to code to screenshot the desktop
http://www.developerfusion.co.uk/show/4630/[^]
|
|
|
|
|
thanks man! but but this code seems difficult to translate, if you know something like this in Delphi, please let me know...
and "grab a screenshot of the entire desktop and then grab the area around your window" seems too slow and I need to draw my window to it myself, like dsct.Canvas.draw(wndpo.x,wndpos.y,wndbitmap);
P.S. I hope Delphi is not a shame here....
|
|
|
|
|
hi all,
I ve a problem.I created a user control(Marquee control,logic:-drawing the string at system.Threading.Timer event),it is working fine.When I place the control in one of the form(form is accessing a web service,will take few seconds to get the data),control is not running smoothly.it is hanging for a while (web serice cause the delay).I created a thread & put the WS,Now the form(GUI) is hanging for a while,when it refresh the marquee text is running like Fast forward for a while.It means the marquee is running at the back ground, but I can not see,how to make marquee visible(running smoothly)
Thanks in advance,
ebin
|
|
|
|
|
Hi, I'm creating a button, that has specified BG color. Color of it's text is calculated using simple algorithm from this BG color. For this purpose, I use HSL color scheme. algorithm of text color calculation is very simple :
Hue - same as background
Saturation - 0
Luminance - if background luminance exceeds 0.5f , set 0F, else 1f
otherwords - use white color if the bacground color is kind of dark, otherwise use black color.
And now my problem :
lets say we have a color like :
Hue = whatever
Saturation = 1f
Luminance = .5f
(that should be clearest mixture for any hue)
the problem is that some color values are very bright in this configuration and some are very dark:
pure blue (0.66 hue) - too dark
cyan (0.5f hue) - too bright
so sometimes the difference(for human eye) between specified background color and calculated text color is almost none (even when luminance difference is at least .5f)
can you help me out with any better way to calculate text color (I would like to keep it in gray scale)
thanx
I hope you'll understand my English ))
|
|
|
|
|
|
I'm trying to add visual effects to the desktop.
I want to be able to use the desktop as normal at the same time.
This is what I have been coding so far. But the triangle is never painted to the screen.
<br />
#include <windows.h><br />
#include <gl/gl.h><br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)<br />
{<br />
HDC hDC;<br />
HGLRC hRC;<br />
float theta = 0.0f;<br />
<br />
<br />
PIXELFORMATDESCRIPTOR pfd;<br />
int format;<br />
<br />
hDC = GetWindowDC(NULL);<br />
<br />
ZeroMemory( &pfd, sizeof( pfd ) );<br />
pfd.nSize = sizeof( pfd );<br />
pfd.nVersion = 1;<br />
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;<br />
pfd.iPixelType = PFD_TYPE_RGBA;<br />
pfd.cColorBits = 24;<br />
pfd.cDepthBits = 16;<br />
pfd.iLayerType = PFD_MAIN_PLANE;<br />
format = ChoosePixelFormat( hDC, &pfd );<br />
SetPixelFormat( hDC, format, &pfd );<br />
<br />
hRC = wglCreateContext( hDC );<br />
wglMakeCurrent( hDC, hRC );<br />
<br />
<br />
while ( true )<br />
{<br />
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );<br />
glClear( GL_COLOR_BUFFER_BIT );<br />
<br />
glPushMatrix();<br />
glRotatef( theta, 0.0f, 0.0f, 1.0f );<br />
glBegin( GL_TRIANGLES );<br />
glColor3f( 1.0f, 0.0f, 0.0f ); glVertex2f( 0.0f, 1.0f );<br />
glColor3f( 0.0f, 1.0f, 0.0f ); glVertex2f( 0.87f, -0.5f );<br />
glColor3f( 0.0f, 0.0f, 1.0f ); glVertex2f( -0.87f, -0.5f );<br />
glEnd();<br />
glPopMatrix();<br />
<br />
SwapBuffers( hDC );<br />
<br />
theta += 1.0f;<br />
}<br />
<br />
return 0;<br />
<br />
}<br />
Have anyone done something like this before?
|
|
|
|
|
Firstly, what do the #include s actually include. I assume they are unimportant and have either been left out or forgotten.
But more to the point, you should have a look at PFD_DRAW_TO_WINDOW in the variable pfd.dwFlags . I too am using OpenGL for a small project I am making. I don't know that much about it but i think you might have to set it to draw to the DESKTOP . I think the desktop is just a special kind of window.
What you are trying to do sounds interesting. Let me know when you have it working
--------------------------------
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
Is there anything out there as an Open Source, that I can use to open the AutoCAD drawing (*.DWG extension)without requiring AutoCAD. I have searched online a lot but didn't find anything useful that I can use in my application development.
Any help in this matter will be great. Thanks for your time. looking forward to hear from the experts out there.
|
|
|
|
|
|
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?"
|
|
|
|
|
|