Search:

Type: Posts; User: jonshouse

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    2,972

    Fixed

    Wrong type of rotation, this fixed it.



    void rotatesp(JSGEfloat angle, JSGEfloat* X, JSGEfloat* Y)
    {
    float ra;
    ra = (angle/360) * (2*M_PI);

    float normalx=*X;
  2. Replies
    1
    Views
    2,972

    2D rotating map in 3D game C

    16569
    16570

    I have a 3D game with a simple opengl game engine. Each object in the game has an X,Y,Z position.

    I want to make a rotating map of an overview of the objects positions. I can...
  3. Replies
    6
    Views
    7,818

    This is just my mental block, I've made this same...

    This is just my mental block, I've made this same mistake before. data is char* so I always expect (wrongly) data+offset to behave at pointer + offset bytes. I will try and learn ! Thanks again.
  4. Replies
    6
    Views
    7,818

    Great job, thanks :) I originally started with...

    Great job, thanks :)

    I originally started with this:

    struct dev_state *ds = (struct dev_state *)data+sizeof(struct jcp_header);

    Compiled ok, but did not work? The extra brackets are...
  5. Replies
    6
    Views
    7,818

    GCC Warnings pointers

    void jcp_parse_and_reply(char *data, int len, char *ipaddr)
    {
    struct jcp_header *jcpheader = (struct jcp_header*)data;
    struct dev_state *ds = (char*)data+sizeof(struct...
  6. Replies
    2
    Views
    4,843

    That works a treat, thanks :-) I am getting...

    That works a treat, thanks :-)

    I am getting careless in my old age...

    Returns 17 not my expected 15 as GCC quite reasonably aligns data[] to a 32 bit boundary.
  7. Replies
    2
    Views
    4,843

    Confused by pointer offset calculation

    I am trying to work out the difference (in bytes) between two members of a packed structure.

    The structure is defined like this:


    struct __attribute__((packed)) jcamsys_msg_image
    {
    ...
Results 1 to 7 of 7