Search:

Type: Posts; User: grady

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    6,604

    I have been trying to make the test program...

    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...
  2. Thread: semi-advanced

    by grady
    Replies
    4
    Views
    1,760

    Linux programming bible...

    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...
  3. Replies
    2
    Views
    6,604

    memcpy with 128 bit registers

    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...
  4. Replies
    11
    Views
    3,322

    The way I would debug this is to write a function...

    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);
    ...
  5. Replies
    11
    Views
    3,322

    I'm not sure what the gluLookat problem is but...

    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...
  6. Thread: VIM Question

    by grady
    Replies
    4
    Views
    1,513

    Yes.... If you do ':syntax on' do you get syntax...

    Yes.... If you do ':syntax on' do you get syntax highlighting?
  7. Replies
    6
    Views
    1,148

    Which symbols are defined depends on the compiler...

    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...
  8. Thread: Newbie Parking

    by grady
    Replies
    4
    Views
    2,454

    C from C the complete reference...

    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...
  9. Replies
    8
    Views
    2,421

    With a hardcode file name you don't have to touch...

    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...
  10. Replies
    8
    Views
    2,421

    The seg fault comes from using tmpnam. Sorry, I...

    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...
  11. Replies
    20
    Views
    1,981

    Re: 2 mathematical / class object questions

    #1.


    union
    {
    struct
    {
    float m11,m12,m13,m21,m22,m23,m31,m32,m33;
    };
    float m[3][3];
  12. Replies
    8
    Views
    2,421

    Re: Reading & Writing files

    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);
  13. Replies
    2
    Views
    2,026

    Re: Problem with C++ in linux

    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...
  14. Replies
    11
    Views
    2,877

    You can't use what bubba is using because he's...

    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,...
  15. Thread: Random Numbers

    by grady
    Replies
    5
    Views
    1,245

    This site...

    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.
  16. Thread: Encryption In C

    by grady
    Replies
    4
    Views
    1,789

    Choose 2 large primes p and q pick e>1 such that...

    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...
  17. Replies
    44
    Views
    5,699

    Right, like I said: Bubba is right but he left...

    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...
  18. Replies
    44
    Views
    5,699

    I think you're saying you are clear about linear...

    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...
  19. Replies
    44
    Views
    5,699

    I admit 'quaternion' does sound rather fancy. ...

    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...
  20. Replies
    44
    Views
    5,699

    So if I have a velocity (2,0,0) and I want to...

    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...
  21. Replies
    44
    Views
    5,699

    Re: Problem with my rotation code?

    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...
  22. Replies
    5
    Views
    2,218

    By pressing keys in the asdf region of the...

    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...
  23. Thread: glVertex4f

    by grady
    Replies
    6
    Views
    7,826

    Not possible. The manual...

    Not possible.
    The manual.
    Linear algebra.
    Dirt cheap linear algebra.
    More advanced linear algebra


    glLoadIdentity( );
    glTranslatef( a, b, c );
    glVertex3f( x, y, z );
  24. Thread: glVertex4f

    by grady
    Replies
    6
    Views
    7,826

    the gl uses 4x4 matrices for transformation. a...

    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...
  25. Replies
    3
    Views
    2,847

    Translate to black dot labeled "pivot point" then...

    Translate to black dot labeled "pivot point" then rotate.
Results 1 to 25 of 27
Page 1 of 2 1 2