I'm sorry. That came out wrong.
I do appreciate everyone's input. It has given me many choices.
Type: Posts; User: MarkS
I'm sorry. That came out wrong.
I do appreciate everyone's input. It has given me many choices.
Two words... Specular highlights.
Awesome! I like that idea better. It will let me support GL 2.x.
Thanks! I had no idea such a concept existed! Now to find an example...
I want to make a retro-style game like Spectre. I'm trying to stay away from depreciated functions. I DO understand that it will work for the foreseeable future. Still, depreciated means going away...
I've found many links to VBO's through this site's wiki. However, while those are informative, they are also completely useless. They all seem to be a general overview. The necessary,...
Slight correction. The decision variable was incorrect in this case:
if(dy > dx)
{
incE = 2 * dx;
incNE = 2 * dx - 2 * dy;
decision = 2 * dy - dx;
OK, here is your code with some minor changes.
Notice the use of the ABS macro. This is all that it took to get it to work in all octants. Now, if you work through the decision variable, you'll...
Right...
:confused:
That *IS* Bresenham's algorithm, or rather, a highly optimized variation of his algorithm.
Is this a homework thing?
Look into time-based animation. It is far superior to a strictly pixel-based movement algorithm.
#define ABS(x) (x < 0 ? -x : x)
#define SIGN (x < 0 ? -1 : (x > 0 ? 1 : 0))
void DrawLine(int x1,int y1,int x2,int y2)
{
int dx,dy,sx,sy;
int accum;
dx = x2 - x1;
dy = y2 - y1;
What are you using to offset the circle? It is centered at the bottom-left corner of the viewport. Also, with a delay of 20 (milliseconds?), the circle is being drawn and cleared so fast you may...
I think gluUnProject will do what you need.
So you are trying to do 3D rotations? It isn't going to look correct since you're using glOrtho.
It you rotate, say, 45° on the x axis and then 45° on the y axis, the object will appear to rotate...
I may be misunderstanding you, but I believe that you want the object to always face the viewer, correct? If so the problem is that you're rotating around the x and y axis instead of the z:
Around...
I've never seen that language before, but I had the same problem in C. Adding this line solved the problem: glEnable(GL_COLOR_MATERIAL);
I would guess that you need to add this line:...
Never mind... I got it to work and it was easier than I thought. One of those "off by one errors". Constraining the mouse to the window worked just fine, after I set ClipCursor to the correct...
I am at a total loss as to how to code this. I'm not even sure what avenue to pursue.
I am trying to get some FPS mouse control code to work correctly. The way the code is right now, there are no...
I can see how OpenGL works by looking at the open source Mesa code. Because of that, there would be little advantage in looking at or stealing your code. The only thing that should be different is...
Well, I narrowed the problem down to the matrix4x4f::rotate function.
I changed it to this:
void matrix4x4f::rotate( const float &angle, vector3f &axis )
{
axis.normalize();
Very rapidly. I did this because I started noticing the view drifting off after a period of time and tried to speed it up. It worked.
Here is the code and binary that shows where I'm at:...
I'm currently using this code:
http://www.codesampler.com/oglsrc/oglsrc_5.htm#ogl_fps_controls
There seems to be a bug in the code, but I cannot locate it. You can replicate the bug by holding...
Math is not my strong point, but I want to say that since it is not commutative, flipping the variable changes the sign.
The question is, does each method give you the same result?
Actually, it would be 90 * 16 * 4, so a little over 5kb, but I see your point.
Thanks for the infomation. I wont be doing anywhere near enough sines or cosines to justify this.
I need to calculate sine and cosine several times in each frame for rotations and camera movements. I haven't counted how many times, but I'm not creating a regular polygon once in the code and...