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();
...
Type: Posts; User: synhyborex
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();
...
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...
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...
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...
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...
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:...
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....
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....
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...
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...
nevermind, i figured it out! for whatever reason when i rewrote
while((nextChar = getc(file)) != EOF) it worked all of a sudden...
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...
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...
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...
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...
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...
@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...
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...
@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
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...
this might be just me, but i don't think you can call a function within its own definition?
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...
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...
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...
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...