You're right, I forgot to mention that each of the tests that was done with the triangle edges and the quad must also be done with the quad edges and the triangle.
The intersection would be a...
Type: Posts; User: Brokenmind
You're right, I forgot to mention that each of the tests that was done with the triangle edges and the quad must also be done with the quad edges and the triangle.
The intersection would be a...
First, you need to better define what you need. The intersection of a triangle and a bounding box rarely has only one point; most of the times, its an edge.
In case you do this without predefined...
The modelviewprojected vector needs to have its w set to 1. After a projection, this w is usually something different, as well as the xyz part, and dividing this by w sort of normalises the vector.
...
As for the last question, it has an easy answer:
You assign the function's return value to an unsigned int, which doesn't have a sign (duh). It isn't returning (int)-1 but (uint)4294967295, which is...
You might get a much faster solution to your problem if you could post the relevant code snippets here, searching through over 1000 LOC is a little tedious :) and you might have as well made a typo...
I assume that most elements in your game are static, so they don't (or hardly) change at all. The general procedure would be this:
Assign data to them space-efficiently, so if you have 10000...
A bit of search resulted in this and this posting. Although they're both for iphone, the functions they use also exist in the normal openGL, namely glBlendEquation and glBlendEquationSeparate. You...
You have one mistake there: The matrix does not take the target point, but the target direction. So your target vector need actually be (0, -500, 0)^T.
If you try to look with the front direction of...
Unfortunately, I'm not familiar with uniform buffer objects, but I have a different approach that could work for you:
With what I coded so far, I found out that shaders seem to have a problem with...
Usually, these two lines should do the trick:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
And yes, this is blending because otherwise, the white background...
Two possibilities:
Use negative texture coordinates, so 00, 01, -11, -10. For this, you have to activate the GL_REPEAT parameter, otherwise the image will be plain black as valid coordinates have...
You don't mean this, do you?
http://www.mariowiki.com/images/2/29/SpecialZone_SMW.png
But seriously, you should specify your problem more clearly. And even if you cannot post URLs here, remove the...
You should be able to figure out the basic theory behind it yourself!
I hope I interpreted your task right because otherwise, the stuff below was for nothing.
Code untested (I only made sure it...
This assignment covers way too many features to be addressed in a single post, and I'm sure the person who gave you the assignment provided you with a basic openGL program. I'll just give you hints...
A test image like the above one? I'm afraid it's from Google ;) But there's an image for everything: Here, for example. I do have selfwritten code for such a sphere, but no project to display it atm....
If you have few points which are unevenly distributed and form a convex geometry around the center of the imaginary sphere, you could extrapolate the values to map a sphere and assign the color...
In openGL, the projection will be performed either with perspective or with parallel projection, which internally are glFrustum or glOrtho. But still, in order to tell openGL how you want to look at...
You need to draw it before you do the transformation that affects the rest of the scene (so right after you load the identity matrix). Then, the screen space goes from (-1, -1) to (1, 1),
I hope you mean gluLookAt. The code is here:
void GLAPIENTRY
gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx,
GLdouble centery, GLdouble centerz, GLdouble upx,...
You got me; I've never done sphere mapping before and thus am not familiar with the coordinate conversion.
If the creation of the texture is computationally efficient, then this is no problem. My...
I'm not familiar with openGL ES but I hope you can use shaders there, because then this will be an easy task:
You simply need to compute the distance between the geometry you draw and the camera,...
If you only have scattered points on the sphere's surface, there is no need for shaders. They work best if you have a mathematical description for the function you want to show, which I thought you...
I misinterpreted the isometric keyword... but could you add a screenshot of what you have achieved so far?
The information are interpreted in the vertex shader.
Let's say for simplicity that the...
I'm afraid I don't understand some of your points, but I've done something like this recently and I'll just describe the procedure here, you could then point out where your approach differs from...
Do you want to assign the colors to each vertex individually and interpolate between them (so that the colors fade), or do you want pixel-precise color transitions showing accurate curves?
The...