Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void read_objs (OBJ_T **list)
- {
- double ctrx, ctry, ctrz, r, R, G, B;
- OBJ_T *node;
- while(scanf("%lf %lf %lf %lf %lf %lf %lf ", &ctrx, &ctry, &ctrz, &r, &R, &G, &B) == 7)
- {
- node = (OBJ_T*)malloc(sizeof(OBJ_T));// cast malloc to on
- node->sphere.ctr.x = ctrx;
- node->sphere.ctr.y = ctry;
- node->sphere.ctr.z = ctrz;
- node->sphere.r = r;
- node->color.R = R;
- node->color.G = G;
- node->color.B = B;
- node->next = *list;
- //node.next goes to list, list goes to node
- *list = node;
- free(node);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement