# Kevn

Member

89

166 Neutral

• Rank
Member

my mind?

wndproc
3. ## Problems Initiating DirectX 11

That fixed it, thank you! :)   Sorry about the error checking. I did have some error checking in place, although probably nowhere near what I should be doing. I know now it was a mistake but I removed the error checks before posting thinking that it would reduce the amount of code people had to read through to help me.

Thank you :)
6. ## Understanding graphics pipeline

Are these processes in the correct order?   1 - orthogonal or perspective projection 2 - vertex transformation 3 - clipping 4 - geometry definition 5 - rasterization 6 - texture mapping 7 - update frame buffer   My practice midterm on computer graphics listed these seven processes to be placed in order. I wasn't given any solutions to the practice midterm, so I would like to know if I am correct. If I am not, can you please point me in the right direction? Thank you.
7. ## Rotating an object along a curve

I wasn't doing it that way, but I will definitely give it a try. That way I can fall back to it if I can't figure out the derivative. Thank you.
8. ## Rotating an object along a curve

Hey, I have an object that follows a Bezier Curve(in 2D), however I need it to rotate with the tangent of the curve as it follows. Currently I am taking the derivative of the Bezier Curve with respect to a time variable u, and taking the x and y coordinates at that u derivative location to use in my rotation matrix. My matrix looks like this:   | x/r  -y/r  0  0  | | y/r   x/r  0  0  | |  0     0   1  0  | |  0     0   0  1  |   where the x and y values are the ones I took from the position at the derivative with respect to u and r = sqrt(x^2 + y^2). Then I multiply this matrix to the object matrix.   Am I going about this correctly? If so, i'm probably messing up on my derivative. If not, what should be I doing?

Thank you :)
10. ## DirectX 10, Collision detection with mouse question.

I'm trying to make it so I can drag objects, like a box, around with my mouse in a DirectX 10/Windows application. So far I only have a plane for the floor, a few boxes, and my mouse coordinates displayed to the screen. What would be the best technique to detect when my mouse is over an object? Do I need to figure out where the box edges are in terms of screen coordinates and then do a compare with my mouse coordinates? If so, how do I determine the location of an object in terms of screen coordinates instead of my world coordinate system?
11. ## Win32 Edit Control Help

Awesome, thank you for the help.
12. ## Win32 Edit Control Help

I am working on a chat portion of a program and I am using two edit control windows and one button for the chat. One edit control window(lets call it chat window) is read only and is where all the text in the chat is displayed. The other edit control window(input window) is where the user inputs text to the chat window. The button(send) takes the text from the input window and adds it onto a string containing the text in the chat window and then updates the chat window text with that string. Now that works fine for placing the text in the chat window.However, when the string length in the chat window is greater than the window size and the scroll bar becomes active, if new text is inputed to the chat window, the scroll bar resets to the top position instead of staying scrolled all the way down. This is problematic because if two users are typing to eachother, they will have to continuely scroll down whenever something new is said to see it. So my question is, how would I go about fixing this or is there a better way to make the chat window portion then using an edit control window?
13. ## glReadPixels wrong values :(

my window setup: [source lang="cpp"]int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutInitWindowPosition(300, 100); glutInitWindowSize(1200, 800); glutCreateWindow("Project 1"); glClearColor(0.0,0.0,0.0,0.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0.0, 1200.0, 0.0, 800.0); glutDisplayFunc(display); glutMainLoop(); return 0; } [/source] And no, i haven't checked errors. I don't know how the OpenGL error checking system works. I'll go look that up now.
14. ## glReadPixels wrong values :(

I am trying to read the color values of a pixel on the screen, however the values I am getting from glReadPixel are whatever color my glClearColor is. Making a point: [CODE] glColor3f(1.0, 0.4, 0.2); glBegin(GL_POINTS); glVertex2i(100 , 100); glEnd(); [/CODE] code to read pixel color: [CODE] glutSwapBuffers(); vector<float> rcolors(3); glReadPixels(100, 100, 1, 1, GL_RGB, GL_FLOAT, &rcolors[0]); cout << rcolors[0] << endl << rcolors[1] << endl << rcolors[2] << endl; [/CODE] I am able to see the red pixel, but the values returned in cout are my clear color, which is black in my case.
15. ## Creating point in OpenGL without glVertex

[sup]not sure what that means [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img] [/sup] [sup]Well, I got my program to draw a line one pixel at a time using glDrawPixels. Only it repeats the same line over and over to the right and left of the line I told it to draw. So like if I told it to draw a line from position (100,100) to (600,600). there will be a line there but then another like from (300,100) to (900, 600). and another so many pixels to the right and left in the x direction over.[/sup] [sup]the code in question, the linebres just uses a line algorithm that calls setPixel however many times needed to draw the line: [/sup] [sup][CODE] struct RGBType { float r; float g; float b; }; RGBType *pixel_buffer = new RGBType[800 * 1200]; using namespace std; int window_height = 800; int window_width = 1200; void setPixel(int x, int y) { pixel_buffer[800*y + x].r=0.5; pixel_buffer[800*y + x].g=0.5; pixel_buffer[800*y + x].b=0.5; } void display(void) { glClearColor(1.0f, 1.0f, 1.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); lineBres(100, 100, 600, 600); glDrawPixels(window_width, window_height, GL_RGB, GL_FLOAT, pixel_buffer); glutSwapBuffers(); delete[] pixel_buffer; glLoadIdentity(); } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitWindowSize (window_width, window_height); glutInitWindowPosition (100,100); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutCreateWindow ("Project 1"); glViewport(0, 0, 800, 1200); glMatrixMode(GL_MODELVIEW); glLoadIdentity( ); glMatrixMode(GL_PROJECTION); glLoadIdentity( ); gluOrtho2D(0.0, 800.0, 0.0, 1200.0); glutDisplayFunc(display); glutMainLoop(); return 0; } [/CODE][/sup]