|
Do you have to use raw strings? Why not use std::string or some other string class? What should happen to the bit of the string that can't fit in the smaller buffer?
Steve
|
|
|
|
|
Sorry for my poor englisch
i hope i can make myself understood
i need a generall help, how to solve this problem
i work with directx sdk 9.0 and visual studio 2005
i have to create a lens (in spectacles).
i got the modell of the lens with all the curves etc.
but:
the lens is made out of colored glass (let us say brown)
so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material.
please help. how to i start to solve this problem
george
|
|
|
|
|
GermanGeorge wrote: the lens is made out of colored glass (let us say brown)
so what happens is, that in the thinner part of the lens the brown is not so intense. in the thicker part of the lens the lens is darker, as there is more material.
Are you only trying to change the color of the lens, or are you trying to model the refraction (light bending) of the lens? In the case of the color change set the color brown to levels from faint to heavy based on the thickness of the lens. Basically make a texture map to represent the color at each point in the material. Alternately, you can have a fixed color, brown, and vary only the alpha (transmitance) value based on the thickness of the lens.
If the idea is to model both color change and light bending of the glass lens, google ray-tracing, refraction, BRTDF caustics and/or global illumination. http://www.gpgpu.org/cgi-bin/blosxom.cgi/Advanced%20Rendering/Global%20Illumination/index.html[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Hi,
thank you for your answer.
no, I only need the colour.
three questions:
1)
can you give me some code for your ideas? i would be glad to pay you for it.
2)
as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility.
3)
which alpha do you mean? the one of the material, the ampient alpha?
sorry
george
|
|
|
|
|
GermanGeorge wrote: can you give me some code for your ideas? i would be glad to pay you for it.
At least until you saw my rates.... I will try to point you in the right directions for free, but I rarely write code for people anymore, just too much time for too little. Plus I am strictly OpenGL most of the time.
GermanGeorge wrote: as the thickness and colour can change with every spectacle: how do i create a texture map in my programm, i cannon hold a file for each possibility.
a texture is simply a map of memory with Red Green and Blue in following bytes, sometimes red, green, blue and alpha. Alpha is a number the same as the other colors representing the transmittance of color to a blending function. Since the blendng function is chosen by the programmer, it isn't a cut-and-dry "this is what alpha is, and this is how it works" but you can find many tutorials on alpha blending in OpenGL or DirectX, your choice. Also with the new shading capability of graphics cards, you can write your own blending function to do what ever level of blending you need.
http://www.codeproject.com/cs/media/3DAlphaTransparency.asp[^]
http://www.falloutsoftware.com/tutorials/dd/dd7.htm[^]
http://www.codeproject.com/gdi/pxalphablend.asp[^]
_________________________
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 am using following code to set the picture(.bmp File) in Picture control. But not getting any picture in picture control.
HBITMAP hBitmap = LoadBitmap(hInst,(LPCWSTR)IDB_BITMAP1);
HWND hWndStatic = GetDlgItem(hWndDlg,IDC_pic);
SetWindowLong(hWndStatic,GWL_STYLE,GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON);
SendMessage(hWndStatic,STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap);
Please help me. Thnx in advance ..
|
|
|
|
|
:-D1.if it is NOT mandatory for you to load it in runtime(through code), then, you can map it statically from the properties box of the control.
:-D2.to load it through code, even i have put more efforts but in vain.
:-D3.so at last, i had to design my own active X control to load an image dynamically. but here, i had to provide the path of the bmp say, "c:\\images\\bitmap1". that was ok for me to fulfil my requirement.
:-D4.if this is ok for you, then i dont mind to share that control(.ocx) with you. but keep in touch through my email id, for me to forward it.
:-D5.it would be great, if anybody answers this question, such that, i can use that logic in most of my future programs.
gudluck.
|
|
|
|
|
This line is totally wrong
SetWindowLong(hWndStatic,GWL_STYLE,GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON); refer the definitions of the Static Control Constants in WinUser.h
#define SS_BITMAP 0x0000000E
#define SS_ICON 0x00000003
#define SS_ENHMETAFILE 0x0000000F
#define SS_TYPEMASK 0x0000001F
so by using (GetWindowLong(hWndStatic,GWL_STYLE) | SS_BITMAP | SS_ICON) you are actually setting the style to SS_ENHMETAFILE. use ((GetWindowLong(hWndStatic,GWL_STYLE) & ~SS_TYPEMASK) | SS_BITMAP) instead.
also shouldnt it be MAKEINTRESOURCE(IDB_BITMAP1) and not (LPCWSTR)IDB_BITMAP1 ?
|
|
|
|
|
Hi Guys
I want to stop USB Bluetooth deviceso how can it be possible to stop.
with Regards
RYK
|
|
|
|
|
VC_RYK wrote: I want to stop USB Bluetooth device...
Stop them from what? If you mean disabling, see here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
pls check CM_Request_Device_EjectW()
Ajay
|
|
|
|
|
hi,
u can disable the usb devices, while changing the registry values
the follwing location have the usb device service set to 3.by changing that value 3 to 4. u can desiable the usb device.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor and double click on "start" word it will show value 3 then u can edit.
this implementation can be done through regstry api which is provided by vc++
ram
Continues learner
|
|
|
|
|
Hello,
My MSDN files are affected when I downloaded new version of internet explorer.
When I press F1 I get the message saying "One or more ActiveX controls could not be displayed"
My MSDN files are now HTML files .
What Should I do to revert them back?
Thanks
Prithaa
|
|
|
|
|
try uninstalling your new internet explorer or reinstalling the msdn and see.
or better put this post in the OS and system admin forum.
gud luck.
|
|
|
|
|
Hi All,
I add tab control on the window area(Not on DialogBox). Which function of CFrameWnd class needs to be override to get the which tab is clicked by user. I want to do all this code in CMainFrame class which is derived from CFrameWnd class. If anybody any solution then please forward it to me.
Thanks in Advance
Atul
|
|
|
|
|
Hit the 'next' button on the forums a few times. This topic has come up 3 or 4 times in the last week. I'm guessing it's part of a homework assignment somewhere...
Waldermort
|
|
|
|
|
Hi,
In my application im displaying bitmap in my view. But now i want animated giff file to display.I searched in net but i get solution to display only in dialog. i want to display in view.Pls help me out.
Anu
|
|
|
|
|
Take thsame steps you used to display the bitmap, but for a GIF you will need to include extra code to load the .gif file and render each frame to a DC. In the case of animated GIF's you may also want to use a timer.
Search on CP, there are numerous articles concerning loading and displaying GIF files.
Waldermort
|
|
|
|
|
thanks for your post.
i would like to learn from you, how you could manage it in dialogs.
please respond, because, i will use in my dialog based applications for better representations.
thank you.
|
|
|
|
|
|
|
|