|
And since playing cards usually have symmetry (unless you're planning on the Tijuana type ), you could draw half the card and complete the rest with two flips, one horizontal and one vertical, and a translation of the first half. The backs usually have even more symmetry and you could get away with drawing a quarter and flipping and translating to fill in the rest. The efficiency of doing so, of course, depends on the intricacy of the patterns you're using.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
WaveK89 wrote: I am trying to draw actual poker cards.
If you want to use a ready made library there is some good information here[^].
|
|
|
|
|
Hi All,
The task which is given to me is that i have to show a cylinder in 3D.Then when i click on any part of the cylinder and drag the mouse i should be able to deform the cylinder and when i leave the mouse the object should be in the last deformed state.I am planning to use directx for this.
Any inputs from you will be very helpful for me.
Thanking you in Advance,
Regards,
Ashwath.
|
|
|
|
|
|
So how committed are you to using DirectX? I could help if you were implementing this in OpenGL, but not DX.
|
|
|
|
|
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Ok, so I have been trawling the web to try and find an answer to this, but to no avail.
Basically, I have a DirectShow filter (well 2) which will allow me to configure a Hauppage WinTV USB adapter (though I doubt the specific filter is 100% relevant to answer the question) to use PAL (I) and to set the source as Composite In. So far, I have found ways to display a filter's property page, and to change the settings of a DMO filter, but not enumerate and change the properties of a non DMO source filter.
The reason for needing to do this is that both filter options seem to reset with Windows, meaning that our source becomes NTSC and Tuner In, rather than Pal-I and Composite In. The filters are classed as a Video Capture Source (WinTV HVR-900H Capture) and a WDM Streaming Crossbar Device (WinTV HVR-900H Crossbar), but the ability to change any property of any filter sans a GUI will be a step in the right direction
I am using a .Net wrapper to play with the filter graph through c#, but have limited knowledge of COM interop (thus the wrapper). Any answers in C++ are fine and dandy also, then I'll worry about how to convert them to C#, just in need of an example really.
What's the easiest method to go about this?
|
|
|
|
|
Please don't spam the forums - ask your question once only in the appropriate forum.
|
|
|
|
|
Sorry, I thought as it was, in fact, relevant to the places I put it, that was acceptable. Was more through my frustration of trawling the web to no avail. Suprised no one else has asked this question before?
|
|
|
|
|
RobstaHendricks wrote: I thought as it was, in fact, relevant to the places I put it, that was acceptable.
No, it just means people get somewhat annoyed at reading the same question multiple times. Check this[^] out for the gudelines on how to use the forums correctly.
|
|
|
|
|
Yep, read that and it said only not to put a link to your post in an inappropriate forum:
"9.Please do not post links to your question in one forum from another, unrelated forum (such as the lounge)."
I understand what you are saying though, but didn't know which of the forums to post in. I'll take note for next time.
Any how, did you know which filter graph builder I should use to import the settings from the GRF file? I expect I'll figure which method to use from there.
|
|
|
|
|
Sorry, I don't know the answer to your query, just hope someone else with the relevant knowledge sees the post.
|
|
|
|
|
Hello,
I am using color picking method to select a primitive in my application.. At present it is picking only single object.. I just wanted to clarify few doubts..
It is working fine when i click on a single object.. I mean if there are two objects lying on the same pixel.. And if i click that pixel, then i get only one object.. How can i get both the objects, using this method..?? Is it possible..??
Thanks in advance
|
|
|
|
|
If you use the standard picking mechanism instead of color picking, you will get hit records for all objects within the selection volume, not just the first object in the Z-order. The standard mechanism is more cumbersome, but the trade-off is that it can be faster.
|
|
|
|
|
But I'm using VBOs.. And SELECT render mode doesnt work there i guess..?? Am i right..??
|
|
|
|
|
gourishsio wrote: And SELECT render mode doesnt work there i guess..?? Am i right..??
I haven't tried it, but I don't see why not. The location of the vertex data isn't really relevant. Once you've created your VBO, you still render it with glDrawArrays (or an equivalent sequence). What may complicate the issue is the fact that you'll have to break up the rendering of the object into a number of steps. Each sub-block that you want to uniquely identify in the hit test will need it's own 'name', and that name will have to be passed to glLoadName before the relevant piece of geometry is rendered. But AFAIK it should work with data stored in a VBO.
|
|
|
|
|
Hello..
I have recently shifted from Display lists to VBOs... It's a very nice thing in OpenGL i found to render huge amount of data smoothly..
Let me explain you the scenario.. I have maintained a list of triangle objects as
std::map<unsigned int, EObjects*> MeshElements
Thus, MeshElements contains all the triangles generated by the mesh generator. Now in order to display, i call a routine first as shown below:
mVertexCount = MeshElements.size();
mVertices = new GLfloat[mVertexCount * 6];
mIndices = new GLuint[mVertexCount * 3];
int v_ind = 0, i_ind = 0;
for( std::map<unsigned int, EObjects*>::iterator it = MeshElements.begin(); it != MeshElements.end(); it++ )
{
EObjects *ob = (*it).second;
mVertices[v_ind] = ob->GetNodeOne().GetX(); v_ind++;
mVertices[v_ind] = ob->GetNodeOne().GetY(); v_ind++;
mIndices[i_ind] = ob->GetNodeOneIndex(); i_ind++;
mVertices[v_ind] = ob->GetNodeTwo().GetX(); v_ind++;
mVertices[v_ind] = ob->GetNodeTwo().GetY(); v_ind++;
mIndices[i_ind] = ob->GetNodeTwoIndex(); i_ind++;
mVertices[v_ind] = ob->GetNodeThree().GetX(); v_ind++;
mVertices[v_ind] = ob->GetNodeThree().GetY(); v_ind++;
mIndices[i_ind] = ob->GetNodeThreeIndex(); i_ind++;
}
glGenGuffersARB(BufferSize, BufferName);
where BufferSize and BufferName are declared globally as follows:
enum{
INDEX_OBJECT = 0,
POSITION_OBJECT = 1
};
static const int BufferSize = 2;
static GLuint BufferName[BufferSize];
Below is my rendering code:
glBindBufferARB( GL_ARRAY_BUFFER_ARB, BufferName[POSITION_OBJECT]);
glBufferDataARB( GL_ARRAY_BUFFER_ARB, mVertexCount * 6 * sizeof(float), mVertices, GL_STREAM_DRAW_ARB );
glVertexPointer(2, GL_FLOAT, 0, 0);
glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, BufferName[INDEX_OBJECT] );
glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, mVertexCount * 3 * sizeof(GLuint), mIndices, GL_STREAM_DRAW_ARB );
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_INDEX_ARRAY);
glDrawElements( GL_TRIANGLES, mVertexCount*3, GL_UNSIGNED_INT, NULL );
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
This code is working fine.. But, only the outer part of the mesh is displayed.. the Inner part is not displayed.. I mean to say, if the mesh is of shape "D", it should have filled all the triangles in "D".. Instead of doing so, it is rather, drawing triangles only along the border of the shape "D" Inner part, triangles are not drawn..
Before using glDrawElements(), i was using glDrawArrays().. It also produced the same output.. So I used, GL_POINTS with glDrawArrays(), just to check if it is reading all the points.. In response to this test, it rendered all the points.. But when i said, GL_TRIANGLES, it is not rendering the inner part..
On the other hand, GL_POINTS with glDrawElements() is also rendering only at the boundaries.. Not inner part like glDrawArrays()..
Is something wrong with my code above..?? Please someone guide me properly..
Thanks in advance..
|
|
|
|
|
At a guess, I'd say it sounds as if you have issues with vertex winding direction and normal vector polarity. If you haven't already, try enabling double-sided rendering and lighting of the triangles and see if they show up. I suspect that the invisible triangles aren't being rendered because you're looking at their backsides, as defined by the normal and the order in which the vertices are fed to the GL engine.
Just a guess.
|
|
|
|
|
how do i do that double sided rendering..?? Sorry i'm new but, i guess, by any chance are you speaking about glEnable(CULL_FACE)...??
|
|
|
|
|
Disable back-face culling - glDisable(GL_CULL_FACE) ; specify double -sided material properties - e.g., glMaterialfv(GL_FRONT_AND_BACK...) ; enable double-sided lighting - glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, TRUE) .
|
|
|
|
|
i want to draw 2D graphic using OpenGL in smartphone or PDA with windows mobile system. but where can i download the opengl libs suport the embed system application?
thanks.
|
|
|
|
|
There is no stock implementation, but there's a freeware library called Vincent[^] that might meet your needs.
|
|
|
|
|
Hi,
Is there any software which can generate OpenGL RGB color code?
|
|
|
|
|
Hi there,
I was messing around with DirectDraw and UpdateOverlay. Unfortunately, there is no transparency support after all. Color keying can only hide certain pixels from a Bitmap, but not parts of the overlay itself.
Is there any other way to draw a hardware overlay with transparency? DirectDraw is pretty old..
Thanks for the upcoming advises.
|
|
|
|
|
Hi everybody,
I'm here in the graphics corner coz it's much more of a general graphics question which starts like "Is it possible...?" or "Does the approach make sense"?
We're restoring an ancient movie, which has severe damage on the blue layer over a huge number of frames. One of the ideas for restoration is to safe a non-damaged frame/image from every scene as reference, erase the blue layer from all the frames and compute it newly for the damaged frames, based on the reference image from the same scene. Seems to make sense, but how to implement such a task in a VB program?
How would I extract the blue histogram from the reference image and implant it into the other frames in VB?
Any advice and/or better idea is very welcome!
Thank you in advance
Michael
|
|
|
|
|