|
Methinks the OP is using OpenGL or something similar...
Steve S
Developer for hire
|
|
|
|
|
you use glPushmatrix() to push the current transformation matrix on the matrix stack ( OpenGL use a stack for transformation matrices ), once you are done doing transformations you can go back to the previous transformation with glPopMatrix()
for example ( from MSDN )
(1) glNewList(CYLINDER, GL_COMPILE);
(2) glPushMatrix ();
(3) glRotatef ((GLfloat)90.0, (GLfloat)1.0, (GLfloat)0.0, (GLfloat)0.0);
(4) glTranslatef ((GLfloat)0.0, (GLfloat)0.0, (GLfloat)-1.0);
(5) (6) glPopMatrix ();
(7) glEndList();
(2) will store the current transformation matrix; (3) and (4) will create new tranformation matrices for the next drawing operations. once the drawing is done, (6) pop matrix to the previous state.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I think you already gt a technical answer. A conceptual one could be:
One reason to push or pop matrices is to "accumulate" matrixes, or, in other words, make "hierarchical" transformations.
For example, if you are animating a robot arm, you may move the finger (relative to the point where it is attached to the wrist).
Then you push the matrix (to save it and "remember" its state) and move the wrist relative to the radio (and the finger should be transformed as well, since the wrist is attached to the radio, and the finger to the wrist).
Then you push the matrix again and move the radio relative to the elbow (and the finger and wrist should be transformed as well). And so on.
In the end you pop all the matrices and get the expected result (combined result).
The result is that these movements allow hierarchical relashionships. If it is programmed correctly, then when you rotate the shoulder joint then all the attached components (humerus, radio, wrist, and finger) will move as if they were all connected (as intended).
The advantage is that you don't have to compute all the individual movements relative to the world, because with push and pop they may be relative to each other. If the "parent" moves then all "childs" move.
Anyway, the programming of these tasks will appear reversed in OpenGL, so take this information as a simple and not so accurate conceptual explanation. Once you grasped the concept and its usefullness you should study the technical aspects and play a little with it (by making objects with hierarchical components, and see the efects of accumulating transformations).
I hope this helps,
Rilhas
-- modified at 18:45 Friday 21st July, 2006
|
|
|
|
|
Hi,
i have created the grid lines using CListCtrl (report view) and inserted data from the database.Now i want to read the data by just clicking on it.How can I read it?
Please help me.
Thanks in advance.
Tejaswini
|
|
|
|
|
b more specfic in framing a question... ur question is not clear.....
|
|
|
|
|
|
I have used CListCtrl in report view and style as LVS_EX_GRIDLINES to get the gridlines.I succesfully got the grid lines.In the columns of the gird lines I inserted data from database. Now if I click on any of the row i want to get the data which is already in it .
-- modified at 5:53 Wednesday 19th July, 2006
|
|
|
|
|
For reading data from the row(items) u can use getitemtext.
Thanks
|
|
|
|
|
for using getItemText() method i have to pass the index of the item and subitem.But how can i know the index.(User may click any of the row item)
Thank u.
|
|
|
|
|
|
Use GetFirstSelectedItemPosition and GetNextSelectedItem
|
|
|
|
|
Thank u Dreamz, I got the solution based on u r idea.
|
|
|
|
|
tejaswini.g wrote: But how can i know the index.(
It's passed to your LVN_ITEMCHANGED handler. You can also get it via GetNextItem() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi there everyone...
Can any one give me example codes on how to move the circle in vertical or horizontal direction once the program starts to run without pressing the keyboard... i can create the circle but i could not move the circle. Any ideas?
Need urgent help here.
Thanks in advance
|
|
|
|
|
Which circle ?
You have to be a LOT more precise and explain the problem clearly if you want an answer.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
You can create a timer . Start the timer in the WM_CREATE.Here I assume that you are working on WIN32 rather that MFC. So you can keep on changing the center coordinates of the circle being drawn in the frame and redraw this in the timer
function.
I hope that this will help you.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Can you be more specific
You can use WM_TIMER and use from x,y that you want to create circle for change location
whitesky
|
|
|
|
|
Hello! I've made a program using Visual C++ (6.0) and MFC classes that connects to a database(SQL Express Edition) and does all sort of things with it. Now I want to be able to save the results comming from a "select from ... where...." in excell file format so I can open it with Excel. Can any one help with tips or something pls.
|
|
|
|
|
You have to search for excel automation. Maybe you can found usefull articles here[^]
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
They could, assuming that unlike many of the posters of questions here, they had the wit and patience to perform a search on the site (or even on Google).
At least they wrote a question which was intelligible. I recognise that for a lot of CP members, English may not be their first language, but it is the primary language used on the site (for good or ill, although as someone who only speaks English/EnglishUS, I'd have to leave if that changed).
Steve S
Developer for hire
|
|
|
|
|
How will I kill all the spawned processes of my application? I dont want to kill my main application, but only the all other processes spawned by my main application? Is there any articles related to this?
Thanks,
Stanly
|
|
|
|
|
When u spawn a process using CreateProcess() u will get the preocss handle of the new process. Store that handle in a Vaiable. So when u want to Kill the spawned preocess, call TerminateProcess() with that handle.
nave
|
|
|
|
|
The problem with me is that, I'm spawning many process. One process my spawn other process. So my spawned process is having many other spawns. But when I'm terminating the main spawned process, only that process is terminated, not the child processes. I want to implement Kill Process Tree function for my child processes.
Thanks,
Stanly
|
|
|
|
|
if all the process u create have window( or create a message only window), u can send the WM_CLOSE message to all the child process. When a WM_CLOSE message arrives, let it send the WM_CLOSE message to its child process and so on...
nave
|
|
|
|