I have been trying to make the test program better since I posted last, and I think you are right regarding the standard register and standard instructions being more optimized. My function gets...
Type: Posts; User: grady
I have been trying to make the test program better since I posted last, and I think you are right regarding the standard register and standard instructions being more optimized. My function gets...
Linux programming bible. This book covers many things including sockets, fifo's, pipes, semaphores, how to compile a shared library and similar 'loose ends'. It doesn't cover threads though, but...
I wanted to know if using the large sse registers in a function like memcpy would be faster than standard memcpy. It seems that it is, but not by too much. I think my benchmark is too unscientific...
The way I would debug this is to write a function like this
void dbg(const char *str)
{
int i=0;
float mat[16];
printf("called at %s\n",str);
...
I'm not sure what the gluLookat problem is but the functions I see that call it, rotateview and updateveiw, don't do a glmatrixmode(MODELVIEW), glLoadIdentity() before they do the glulookat. Is the...
Yes.... If you do ':syntax on' do you get syntax highlighting?
Which symbols are defined depends on the compiler you are using. Googling for "gcc always defines" indicates __GNUC__ for gcc. Googling for `"always defined" visual c++` indicates _WIN32 will...
C from C the complete reference. Xlib and Opengl from the links in my sig. Linux specific stuff from the linux programming bible. This C/C++ quick reference. Nvidia has lots of useful stuff for...
With a hardcode file name you don't have to touch tmpnam at all, and you can get rid of the char *tmpfname. Sorry for the tmpnam confusion and slop code. The point is to make the fread, and fwrite...
The seg fault comes from using tmpnam. Sorry, I hadn't actually used it that function before; I didn't want to overwite any of your files. Just hard code a file name and it will work.
mkstemp...
#1.
union
{
struct
{
float m11,m12,m13,m21,m22,m23,m31,m32,m33;
};
float m[3][3];
What Machewy gave is C++.
#include<stdio.h>
int main()
{
int i,j; /*int's are four bytes long*/
FILE *file;
char *tmpfname;
printf("Enter integer: ");
scanf("%d",&i);
Doing a man on any of these functions will tell you what header they are in. Googling "man rand" will bring up the man page for rand and this works for most any C function and alot of other things...
You can't use what bubba is using because he's using Window's API and Directx. You could google for bitmap header format and figure out how to open the file yourself.
Since you are using linux,...
This site explains how to use the generator that your compiler's rand() probably implements. However, linear congruential generators are very bad compared to other generators out there.
Choose 2 large primes p and q
pick e>1 such that gcd(e,(p-1)(q-1))=1
Let n=pq
encoded symbol M as C=M^e mod n
solve ed=1 mod (p-1)(q-1) for d
Decode coded symbol C as M=C^d mod n
e and n are...
Right, like I said:
Bubba is right but he left out what I referred to as the post processing. first tranlate to (x,y,z), rotate, then translate to (-x,-y,-z). This puts your rotated vector back...
I think you're saying you are clear about linear velocity. Rotations are caused by angular velocity, and the parameters for an angular movement are different from those of a linear movement. You...
I admit 'quaternion' does sound rather fancy. I'm just pointing out possible things that might be cumbersome in your method, and having a discussion about vectors in general, nothing personal. If...
So if I have a velocity (2,0,0) and I want to accelerate it (0,-0.1,0). You're saying that for linear accelerations (2,0,0)+(0,-0.1,0) is less logical and slower than doing a rotation and updating...
In the manual you can read all about how glulookat works. Then you'll see how keeping track of a world position and a view direction, and updating the rotation matrix using a fast lookup table for...
By pressing keys in the asdf region of the keyboard I got all the images to disappear on the window so the window was just light blue. Then the word "deactivated" came up on the screen. Then all of...
Not possible.
The manual.
Linear algebra.
Dirt cheap linear algebra.
More advanced linear algebra
glLoadIdentity( );
glTranslatef( a, b, c );
glVertex3f( x, y, z );
the gl uses 4x4 matrices for transformation. a translation is stored in the 4th column of that matrix. A 1 is always at the 4th col, 4th row of the matrix. The GL is always using 4 vectors...
Translate to black dot labeled "pivot point" then rotate.