Search:

Type: Posts; User: synhyborex

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Reanalyzing my code, I've realized that I'm not...

    Reanalyzing my code, I've realized that I'm not properly allocating memory for my left and right nodes. Here's the class definition of a BVH_Node:

    class BVH_Node{
    public:
    BVH_Node();
    ...
  2. Ok, I think I got it. Would it be beneficial to...

    Ok, I think I got it. Would it be beneficial to change the prototype of the constructor to take a const vector<GeomObj*>& rather than the way I've done it?

    Also, I just use the given...
  3. If you would like, I could post more code. Just...

    If you would like, I could post more code. Just let me know what you need to see. Also, I don't believe I'm passing a reference of my vector into my constructor, but rather the object itself. Is this...
  4. passing a vector to a function, getting negative length and size, aka segault

    Hello,

    I am writing a raytracer, and currently I'm working on creating a bounding volume hierarchy to accelerate the process. To do this, I am first creating a vector that holds each of the...
  5. Replies
    2
    Views
    791

    Yes, that's the gist of it, though my actual...

    Yes, that's the gist of it, though my actual color takes into account calculations for both Phong and Gouraud shading in the fragment and vertex shaders, respectively. The calculation part is what I...
  6. Replies
    2
    Views
    791

    Some More Shader Questions

    The boards seem a little dead today? Geez I feel bad being the two most recent posts. However, a man has needs ;)

    I've gotten significantly further in my program, but I need help with two things:...
  7. Replies
    1
    Views
    2,000

    Nevermind, I realized what the problem was. For...

    Nevermind, I realized what the problem was. For some reason my file was saving to an entirely different folder, so now the binding is properly occurring, as well as getting the fragment shader run....
  8. Replies
    1
    Views
    2,000

    OpenGL Vertex Shader

    Hello,

    I'm having trouble binding my handlers to my vertex shader, as well as getting to my fragment shader. Not sure if this is the right forum, but I found a lot of OpenGL threads in the search....
  9. Replies
    8
    Views
    1,693

    The simplest way (if you don't want to change too...

    The simplest way (if you don't want to change too much code) is to just set what's called a sentinel value. Essentially, you want to put all the code you want repeated inside a giant while loop that...
  10. Replies
    2
    Views
    1,709

    World to Screen Coordinate Transform

    Regarding the transformation itself, it's not a problem. However, where I continually run into trouble is when i need to preserve the aspect ratio if the screen size changes. In other words, if I...
  11. nevermind, i figured it out! for whatever reason...

    nevermind, i figured it out! for whatever reason when i rewrote
    while((nextChar = getc(file)) != EOF) it worked all of a sudden...
  12. putchar adds an extra newline i don't want

    so the program i'm writing is basically writing the expand function on a unix-based OS (expand takes any 'tab' keys of an input and converts it to spaces), and while i'm mostly done, the issue i've...
  13. Replies
    5
    Views
    1,317

    Well that was awful dumb now that I think about...

    Well that was awful dumb now that I think about it...thanks a bunch! **Just changed the pointer-- to --pointer** and it worked perfectly afterwards I made a few printf changes I was failing the test...
  14. Replies
    5
    Views
    1,317

    Here's my driver file (I've edited out the code...

    Here's my driver file (I've edited out the code that isn't relevant):
    #include "stack.h"

    int main(int argc, char *argv[])
    {
    int state = 0, value;
    char choice = ' ';

    printf("Welcome to...
  15. Replies
    5
    Views
    1,317

    I'd post more, but I have to manually type out...

    I'd post more, but I have to manually type out any code I have since I'm using Bitvise xterm console for remote access to the server...any idea how to copy/paste from xterm console onto the system...
  16. Replies
    5
    Views
    1,317

    Stacks in C -- Array Implementation

    So we're doing a refresher on C in class and I don't remember how to deal with pointers, which is probably what makes this so difficult.

    For the prototype
    int pop(int *value) I need to write the...
  17. Replies
    28
    Views
    2,874

    @phantom like i said in the OP, i'll fix that...

    @phantom like i said in the OP, i'll fix that stuff later. this is my first quarter learning C, so doubling the terminator doesn't top my priorities list. also, it doesn't double right now. might...
  18. Replies
    28
    Views
    2,874

    hey thanks you guys, but i figured it out. this...

    hey thanks you guys, but i figured it out. this is what i changed that while loop to:



    for(i = 0; i < DIM; i++)
    {
    fscanf(database,"%s %s %d %f...
  19. Replies
    28
    Views
    2,874

    @bayint, count represents how many lines are in...

    @bayint, count represents how many lines are in the file, or how many students are in the database.

    here's the file:



    John Doe 1234 3.50
    Jane Smith 2543 3.51
    Bob Jones 1000 2.43
  20. Replies
    28
    Views
    2,874

    thanks for fixing my fclose, tater. but if you...

    thanks for fixing my fclose, tater. but if you look at the OP, where i put in the three examples of where i'd tried the count++, the place where you put it results in the value of count being 1000. i...
  21. Replies
    2
    Views
    1,098

    this might be just me, but i don't think you can...

    this might be just me, but i don't think you can call a function within its own definition?
  22. Replies
    28
    Views
    2,874

    incrementing a variable while using fscanf

    i've been stuck on this for a while, and i've tried a variety of things, most of them resulting in segfaults. i basically want to increment my variable "count" each time there's a new line in the...
  23. Replies
    7
    Views
    2,169

    unfortunately bayint, i need to put things in...

    unfortunately bayint, i need to put things in order...there are four values for each structure: two strings, an int and a float. for strings, i need to keep it alphabetical, and for the int and float...
  24. Replies
    7
    Views
    2,169

    alright that makes life easier in terms of...

    alright that makes life easier in terms of structures.

    so i figured for the loop that would run the array[pos] = array[pos+1] i could stop at "length-1", but then my question becomes how would i...
  25. Replies
    7
    Views
    2,169

    kk that makes sense. now with structures, would i...

    kk that makes sense. now with structures, would i be doing essentially the same thing? for example, array[pos].x = array[pos+1].x?

    also, when i reach the last element, since no element exists...
Results 1 to 25 of 44
Page 1 of 2 1 2