General Category > General Anim8or Forum
WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
cooldude234:
3d calculus, I probably could never sit through a course of that :P (even though I probably really need it)
Well for starters, I'm using OpenGL so everything is computed through matrices. The world has one matrix, and the objects have a matrix so there are matrices in matrices.
Though what I'm doing is just getting the angles of things and letting OpenGL display it in a matrix (I say where to put it, OpenGL puts it there). I'm using a function (gluUnProject) that gets the 2D coordinates of the mouses position and reverses the main matrix to get its position as a 3D vector. I can define on how far back I want to "unproject" the mouses position (I can define a mouses depth). So I unproject the mouse twice, once close to the camera, once far from the camera (NOTE: OpenGL computes the angles of the screen, so when I say depth I do not mean the worlds z coordinates, I mean its the depth relevant to the area that the screen is viewing). Then I get the angle from those two points (as I have solved with Raxx's help above).
Now what I'm doing with this angle is...
I have a for loop (a type of loop in computer programming for those who do not know), that goes through for a number of times (which is the "life" of the ray), and moves a certain distance (which I can define as any amount I want, for now its just moving a distance of one tenth (0.1)).
So I'm trying to figure out how to use sine and cosine to compute the yaw and pitch of the ray and the distance to move by and put in a 3D vector coordinate (so compute yaw and pitch, to get the amount of x y and z to move by).
There are multiple ways to make rays, I want to implement at least these two ways...
The way I have above
and an intersecting point, which contains two points, and finds the intersection of objects and whatever in the line formed by those two points.
The reasons why I want the one above, is because then you could cast the ray to infinite space (for as long as the application is running you could have the ray moving). The reason why I want the other way, is to have accurate and quick results.
Also I'm planing to combine the two ways, cast a ray that moves a distance then checks if there was an intersection between that position of the ray and the last. So I could have the infinite ray and accurate results together. Basically I'm making it so that you could use rays to the max.
cooldude234:
Oh, AND OF COURSE I'VE CHECKED GOOGLE...
That was the first thing I did.
cooldude234:
OHHHHHHHHHHHHHHHH YEAAAAAAAAAAAAAAAAAA!!!
Says the koolaid man :P
Great news!
I have just got mipmapping to work! As well as I am using gltexture2d now, which is more compatible, and yet on top of that! I still have non power of two textures working!!!! BAM! Imma in a goood mood now (:
I mean, it only took 7 months to find out the solution
So for those less techy out there, mipmapping (in 3d graphics) is the process of making copies of the texture, but each copy is a downsized-smoothed version of the texture usually dividing it by two each time (first texture actual size, second half, the third half the the second and so forth), and using the texture(s) according to the distance from the view point so that the further the texture is, the more downsized it is. This makes the system run much much faster as well as making the scene look much better as it gets rid of great pixelizing distortion. In fact anim8or uses the mipmapping process, you can see it in the textures when you zoom out far enough, or got on a certain angle from the face.
EDIT: and happy 10 hours late new years :P
cooldude234:
I just tried it out on the intel graphics (netbook), and it works 100%
This pretty much mean that any lower end pc's are now compatible (which is well over probably 50% of the users estimating)
cooldude234:
Back to the ray casting issue, still haven't solved it, though a better name to give what I'm trying to do, is convert a 3D a yaw and pitch into a normal vector (or a directional vector). Just in case that helps to spread some light on this problem.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version