|
Hello again.
It took some time to read your post (my English isn't the best at all)
Ookay, let's have a look at your questions:
Q1) I'd like to use vectors of structures point, surface, line.
something like
struct point {
float pos[3];
int s, t; // for texturing
bool textured;
bool visible;
bool active;
};
struct line {
long pointa, pointb; // index of two points
bool visible;
bool active;
};
struct surface {
long pointa, pointb, pointc;
bool active;
};
Q2) to privde a HDC to the lib seems to be fine.
Q3) if the lib gets a HDC I should be able to create four or more windows on my own, or not? each window would only have one perspective (front^top^side^perspective)
Q4) I think source may stay yours but it should be free to use in any way.
Q5) if you mean server-client architecture as opengl, I'd say yes.
I1) I think that'll be okay. Maybe it would be useful to set a switch for drawing the points and lines to the perspective view (as well as the texture?)
I2) external means that I want to manage these lists in my progam so the library only has to draw them. The lists will be given to the lib as parameter to the create function. That way i'll be able to use more than one window for creating my objects and I can use lines for bone animations
I3) my program could send a function call "setAction(int action_type)" to the lib
I4) The only thing that's needed is to select points. If I move a point, the trangles or lines will follow.
I5) I don't really understand what this question means, but think you're right
I6) if you mean the multiselect, a single point select combined with CTRL may be a siple way to handle this?
I7) my idea was to use a window which shows the texture where I can move a pointer which is automatically transferred to a selected point. Render a spherical projection to the object would be a nice init for the texturing process. Btw: Blender has a funny feature: you can spray your texture directly to your object but I don't believe that one can get useful results.
Well I hope my suggestions aren't too difficult
|
|
|
|
|
Sorry for the delay in my answer, my home computer died on me so I'm using the computer at work.
Q1) Seems fine.
Q2) Ok. There is a performance penalty in using HDC's external to OpenGL, but not very significant. The alternative would be for the lib to own the window, which I don't think you would find interesting.
Q3) Yes, could be one way or the other. The lib could draw only one of the windows to the HDC you specify. This means that you could use the same window or use a diferent one. The important point to note is that the lib would need 4 calls to draw the 4 views, instead of one call to draw them all (which would be less efficient, generally speaking).
Q4) Well, in the spirit of my participation at this forum I would not impose any constraints on usage and distribution. The cost issue is pertinent only to any amount of work I would have to do (and this still has to be estimated for me to see if I could do it for free or not). If there was a cost and you decided to pay then the usage and distribution would be free.
Q5) Yes, that was what I meant, but I assume a local architecture (not using TCP/IP or any similar form of distribution).
I1) Ok.
I2) Ok.
I3) Ok.
I4) Ok, that's great!
I5) Ok. This became clear to my with your struct example. Moving selected points results in changing whatever objects are associated with them (either partially or fully).
I6) Ok. Also clear now.
I7) Ok.
Well, I think your sugestions actually ended up simplifying the whole thing. I also assume that all load/save functionality is provided by you, including textures. This means that some requirements may be imposed on them, like:
I8) Do you wish to provide any RGB/RGBA texture map and the lib automatically transform it to match OpenGL's requirements? This typically requires rescaling.
I9) You do not provide a struct example for textures... I assume you don't want to use a single global texture, in which case we should define the concept of object so that each object can have an associated texture. Can I assume that each object can only have one texture? I think this could be simple, like:
struct object {
struct point* point_table;
long point_table_count;
struct line* line_table;
long line_table_count;
struct surface* surface_table;
long surface_table_count;
struct rgba* texture_rgba;
}
I10) I have not tested the usage of untextured points in the middle of textured surfaces. I don't think it works as one might think. So I propose that the object contains information of if it's points are textured or not, and not the points individually. Anyway, each point would still have its s and t. The same applies to the visibility of points (what is a triangle if one of its points is not visible?). Or would a surface drawing consist of its fill, its edge lines, and its individual points?
So, to sumarize, only the newly added I8), I9), and I10) are open issues, all the rest I think are well understood.
Rilhas
|
|
|
|
|
hi,
I8) keep it as simple as possible. I think I can create and handle textures on my own
I9) To my mind a GLUInt for the texture id should be enough? Maybe s and t could be a float value between 0.0 and 1.0. Texture handling can be my task..
I10) I would try to check if any point of a surface is visible. if a point is invisible, the surface shouldn't be drawn.
I again didn't really know what you mean (at least in I8) but I hope your questions have been answered..
|
|
|
|
|
Hello,
I wrote a simple programm using Visual C++ where I want to move a cirle
in a window via drag&drop. I used the pDC->Ellipse() and the
InavlidateRect() functions for drawing the circle.
So far it works. But I have two problems:
1. When I move the mouse quickly during a drag&drop, not the entire
"old" cicle disappears so that I get a trace of the way I moved the
cicrle around
2. How can I implement that with a flicker-free window? (perhaps the
InvalidateRect() and pDC->Ellipse() functions aren't very useful for my
intentions and I should use other functions)
Uday kiran
|
|
|
|
|
hi,
the winapi gdi is - as far as i know - not the fastest. An ellipse is rendered by using pDC->Ellipse(). this needs time, so it flickers..
Perhaps you should use directx?
another way may be to use double buffering.
|
|
|
|
|
no need to re ask... you did it 1hour ago. now wait
|
|
|
|
|
The answer to both of your questions is to use a double-buffering scheme. Basically, you will create a device context that isn't displayed to the monitor, draw to it, then copy all the bits to the screen at once. Do a search on this site for CMemDC and you will hit a couple articles that do exactly that.
When dealing with graphics that change regularly, do not draw them to the screen directly or you will have the flicker problem.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello,
Is it possible to somehow access Web Services using Microsoft eMbedded Visual C++ 4.0?
If so - Is there any example that does that?
Thank you & regards,
-Andrej
|
|
|
|
|
Hi All,
I have been toiling around with using XMLRPC.Searching on Google didn't provide with any good links or articles. I want to know how to use XML RPC with VC++, where do I get the libraries from, and some samples from which I can gain knowledge about XML RPC.
Can anyone make me point to some article/source sample?
Thanks in advance.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi
can we add tooltip to a static text control in win32 Application??
If yes, then how??
Manjunath S
Bangalore
|
|
|
|
|
hi Manjunath,
It is possible to add tooltips for the Static Text, In the Resource Editor for every StaticText ID give a meaning String value.
in the Coding part call CString.LoadString(IDC_ResourceSringID);
Then use CToolTipCtrl ctr;
Ctr.Create(this);
and Try....
//==================
uday.
|
|
|
|
|
HI all,
I have created a ellipse using
CDC::Ellipse(...). but once i have created that ellipse i want to move the ellipse what i have created.
//======================================================================
if((insidepoint == true ) && (nFlags & MK_LBUTTON))
{
CRect rect;
GetClientRect(&rect);
ClientToScreen(&rect);
SetCapture();
nOldMode = dc.GetROP2();
dc.SetROP2(R2_NOT);
one.CreatePen(PS_DASHDOT,1,RGB(200,200,0));
old = dc.SelectObject(&one);
dc.SelectStockObject(NULL_BRUSH);
double dia = sqrt((array[2]-array[0])*(array[2]-array[0]) + (array[3]-array[1])*(array[3]-array[1]))/2;
//dc.Ellipse(OldPoint.x,OldPoint.y,(point.x + dia),(point.y + dia));
dc.Ellipse(point.x,point.y,(point.x + dia),(point.y + dia));
OldPoint = point;
dc.SetROP2(nOldMode);
dc.SelectObject(old);
showCordinates(point);
}
//======================================================================
please let me know any solution.
uday.
-- modified at 6:44 Tuesday 1st August, 2006
|
|
|
|
|
|
hi whitesky,
i have created an ellipse using cdc::ellipse(...).
but once it is created, and the mouse is entered into the ellipse what i have created, if i press the Left button and dragged the ellipse what i have drawn, it should move accordingly with the current position of the mouse.
please help me out. It is really a challenging task.
//===========================================================
if((insidepoint == true ) && (nFlags & MK_LBUTTON))
{
CRect rect;
GetClientRect(&rect);
ClientToScreen(&rect);
SetCapture();
// nOldMode = dc.GetROP2();
dc.SetROP2(R2_NOT);
one.CreatePen(PS_DASHDOT,1,RGB(200,200,0));
old = dc.SelectObject(&one);
dc.SelectStockObject(NULL_BRUSH);
double dia = sqrt((array[2]-array[0])*(array[2]-array[0]) + (array[3]-array[1])*(array[3]-array[1]))/2;
dc.Ellipse(OldPoint.x,OldPoint.y,(point.x + dia),(point.y + dia));
dc.Ellipse(point.x,point.y,(point.x + dia),(point.y + dia));
OldPoint = point;
// dc.SetROP2(nOldMode);
dc.SelectObject(old);
showCordinates(point);
}
//===========================================================
please help me out.
uday.
-- modified at 6:54 Tuesday 1st August, 2006
|
|
|
|
|
if i understand you need to WM_LBUTTONMouse and WM_MOVEMOUSE
for your purpose and you can use from point for position x,y in these messages
-------
i think you can use also from a control (button or...) with a shape like ellipse instead this way
|
|
|
|
|
Hello,
I wrote a simple programm using Visual C++ where I want to move a cirle
in a window via drag&drop. I used the pDC->Ellipse() and the
InavlidateRect() functions for drawing the circle.
So far it works. But I have two problems:
1. When I move the mouse quickly during a drag&drop, not the entire
"old" cicle disappears so that I get a trace of the way I moved the
cicrle around
2. How can I implement that with a flicker-free window? (perhaps the
InvalidateRect() and pDC->Ellipse() functions aren't very useful for my
intentions and I should use other functions)
Uday kiran
Uday kiran
|
|
|
|
|
Hi Friends,
I have a question about RTTI.
1) In C++ we have vptr pointing to vtables which helps to make use of
pointer as polymorphic entities.
2) Without knowing object type I can call methods of object using
those pointers.
So in which case RTTI is needed? ( Why I need to know my object
type?) What is the use case?
Vikram S
|
|
|
|
|
class CObject {}
class CCar : public CObject {}
class CBus : public CObject {}
class CBike : public CObject {}
std::vector<CObject> vecVehicles;
then, how do you know if the elements inserted in the vector are Cars, Buses or Bikes without RTTI ?
|
|
|
|
|
toxcct wrote: then, how do you know if the elements inserted in the vector are Cars, Buses or Bikes without RTTI ?
Right!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
I wrote a batch file, with I call from my VC program, but....
Well first of all, I would like to know if it is possible to put sql scripting in a batch file for execution?
I can connect to the MySql Server with a batch file but can't execute anymore commands (MySql command like reading from a file). I don't know how to do this, so If anyone could point me to a site or help me .... well just thanx in advance
Regards
Programm3r
Regards
Programm3r
|
|
|
|
|
this is more a question for the SQL forum[^] or even for the general questions forum
|
|
|
|
|
Thought so ..... my bad
Thanx anyway
Regards
Programm3r
|
|
|
|
|
A batch (.bat) file is nothing more than a collection of commands that could just as easily be executed from a command prompt. That said, if you can issue the SQL commands from a command prompt, then you can also do such from a batch file.
"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,
I have one program which writes some text to a file, and save it and closes.
If we click on the file the contents can be read {text file}.
I want to know is there any way I can make a file unreadable when its opened from outside, I want to know to how to compress when file when it is closed and uncompressed when it is opened by the program.
Can u please give me some suggestions.
Thanking you,
Suresh H.
|
|
|
|
|
Why don't you encrypt/decrypt it?
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|