|
r is the radius of the current postion in the source image, in polar co-ords. pixelRadius is the radius of the circle we're working with. sourceFOVRads is the parameter I need to change based on radius in the source image. I've done some code to try and do this with the current transform, but it doesn't work 100%.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In general there is a good reason why such algoriths iterate over the destination image - It ensures that the destination image is fully covered (no gaps) and that we don't get multiple writes to a single pixel.
Steve
|
|
|
|
|
That's why I said 'naturally'. However, that won't do in this case, I need to change how the destination pixel is calculated based somewhat arbitrarily on how the position in the source changes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Not sure if this will help or just add confusion. The following is from some finite element modeling in cartesian coordiantes. It applies to any geometric view however. Think of a stage with props and cameras on it. As you move the props or the camera dolly around you change the view the camera has of the props. To calculate the view the camera sees, you need the inverse direction cosines of the cosines that position the camera on the stage. To do so: you need to find a point on two of the inverted axis, which just happen to be definable by the cosines that define that axis's direction.
void CFemEditView::invertdc()
{
// CALCULATE A POINT ON THE INVERTED Z-AXIS.
dciz.x=dcx.z;
dciz.y=dcy.z;
dciz.z=dcz.z;
// CALCULATE A POINT IN THE INVERTED X-Z PLANE.
dcix.x=dcx.x;
dcix.y=dcy.x;
dcix.z=dcz.x;
// FIND NEW Y AXIS COSINES.
dciy=cross(dciz,dcix);
}
Beyond this it is far to late on a Saturday night for me to think clearly. Good luck.
"Simplicity is more complicated than you think. But it’s well worth it” (Ron Jeffries)
|
|
|
|
|
This may help: http://www.euclideanspace.com/maths/geometry/coordinatesystems/polar/[^]
I deal with 3D image projections, so you will have to forgive me if I walk through this step by step (it is as much for me as you). I promise I am definately not being condescending by stepping through it.
atan gets the angle of a rise over run angle (y/x), atan2 simply separates the y,x values in order to guarentee you a correct quandrant result since -y/-x is equivalent to y/x atan must be verified for quandrant based on the incoming values. atan2 does that for you.
theta= atan2(z,x) is the angle from z/x where normally y would be in the place of z.
This means that z=r sin(theta) and x=r cos(theta)
now reversing phi to y, you already know x,z so you can easily get the known distance to x,z which is what the sqrt(x*x+z*z) is getting you. so y is the only unknown
well, y is in the x position of the atan result so you don't even have to worry about the distance portion.
y=r cos(phi) though you might want to verify that dist(x,z)=r sin(phi) just as a double check.
(I learned a long time ago when you deal with 3D surface projections, double checking your work by finding the redundant parameters is a good thing -- just remove them if you need the speed after doing your initial tests)
[edit: hopefully that is all correct, I didn't check it, just walked through it from your code]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-- modified at 21:04 Saturday 14th January, 2006
|
|
|
|
|
Thanks - I'll try this and see how I go. I really, really appeciate it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi,
any body has a tic tac toe source in vc (3D mode)
please guide me ,peyman13618@yahoo.com
thanks
-- modified at 16:24 Saturday 14th January, 2006
|
|
|
|
|
You're thinking of rentacoder.com
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
A long time ago now I wrote some code to access the individual frames/bitmaps that make up a video file. I used the Video For Windows API and this code works great on WinXP. However I would like to rewrite it, as I understand it Microsoft aren’t pusing VFW anymore. Can anyone tell me which technology I should focus on? It is important that it doesn’t require any redistributables and will run on out of the box XP.
Anyone any thoughts? Now of any resources?
|
|
|
|
|
DirectShow is what you want.
MS has a free SDK with a bunch of sample programs. i think the frame extraction one is called "SampleGrabber".
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi..
I m working on image processing...i m beginner of VC++ 6.0..i dont know how to load and display image meanz if i open any image through file dialoug it will display in non client area of window in SDI..
|
|
|
|
|
try this ,you will just have to pass the device context to the class,
http://www.codeproject.com/bitmap/cpicture.asp
Z.A
|
|
|
|
|
i m making Paint..i need memory device context
i did it but it doesnt work
did like daT
static int i=0;
if(i==0)
{
memDC.CreateCompatibleDC(pDC);
i++;
}
pDC->BitBlt(20,10,436,364,&memDC,0,0,SRCCOPY);
if i draw line i call invalidate it repaints so wht i draw in my device context i also draw in mem dc
but it doesnt work???
|
|
|
|
|
you need to select the bitmap into your mem DC by SelectObject(...) function.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
i tried but it gives assertion failure
|
|
|
|
|
there are million of samples in VC disk.
try to search the function you used inside these samples.
VC samples are first place to go for learning something new.
when you test your functions (calling process), be careful to find which function doesn't work.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
|
I'm doing some subclassing to allow only digits and one only of three allowable alpha characters at the end of the edit string. I'm overriding OnChar and find a need to modify the existing string before passing the allowable characters on. However, when I pass any character other than the character trapped by MyCEdit::OnChar to CEdit::OnChar it still results in passing the trapped character.
I assume this is the way the system behaves but I don't understand why. Could someone enlighten me? The way I'm getting the job accomplished feels rather kudgy to me and I'd rather avoid it if I can.
Thanks,
Lilith
|
|
|
|
|
try to override WM_KEYDOWN (OnKeyDown?) also.
if you control both OnChar and OnKeyDown, it should work.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
if you control both OnChar and onkeydown, it should work.
This is the note given in MSDN explaining the correct scenario explaning that you cant fool the system .
Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.
in your case map the EN_UPDATE ,check wether the characters are integers and if the count goes above 10 , you do the required .
Regards
FarPointer.
|
|
|
|
|
Actually that's what I originally did except that I used EN_CHANGE, which may have been a mistake. Although a similar approach had worked before, this time I somehow got an odd character at the beginning of the string when I re-read it from the edit control.
Using a combination of OnChar to filter the input and EN_CHANGE to process the string at least would have the benefit of reducing my logic's complexity.
Lilith
|
|
|
|
|
I want to build an application which is determine the time a customer use a computer (a netcafe' software, like that). But a customer can easily endtask my application with TaskManager. Is there a way to prevent the app ended by the user ( the user may be log on admin acc) ? I know many program cant be endtask (and the most is viruses ~.~), but I dunno the tech. This is not just prevent user open TaskManager.How I solve this problem ?
Tnx all.
-- modified at 22:09 Friday 13th January, 2006
|
|
|
|
|
The best way would be not to get tricky and simply use the normal security architecture - ie. Not let the user log on as an administrator and set up permissions so they can't kill stuff. If, for some reason, this isn't feasible, it is possible but beyond most programmers (including me). Check out this - Read the bit under the "Kernel-mode Rootkits" heading. This would have to be done in kernel mode which is nothing like user mode programming and where mistakes are fatal. After going to all this trouble you might find that virus scanners and other tools think your app is a virus or rootkit.
Steve
|
|
|
|
|
a technique i have used is to run two processes -- let's say your app is tracker.exe, i would use tracker.exe and tracker_helper.exe. basically in both apps, use the WaitForSingleObject function, to wait for the other's process handle. if it is killed, just respawn the other process again.
of course this will be conspiciouos, if you want to stop people from seeing that you are doing this, maybe use srvtasks.exe or something kernel-sounding for the second one and put it in a system folder. (possibly ????)
still, if the user knew what they were doing, they could write an app to kill both processes simultaneously. if you don't want that, you can probably write a security descriptor for you main process and apply it somehow (sorry, can't help you there). if you have norton antivirus you can try to kill navapscv.exe and see what i mean.
hope that helps
|
|
|
|
|
I need to start another process from my program and pass it some arguments. Anyone know how to do this using VC++.Net Under Visual Studio 2003? Please Help if you can. Thank you
Pablo
|
|
|
|