- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 6
- Upvoting Members
- 5
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
Forever learning and reaching higher!
- Interests
- Guitar Exercise Programming Making money ;)
53 Posted Topics
Re: [CODE]Vector3 forward = target - eye; forward.normalize(); Vector3 side = Vector3::cross(forward, up); side.normalize(); up = Vector3::cross(side, forward);[/CODE] I don't understand why you are recalculating the up direction..... Surely you already know it at this point otherwise your side direction would be calculated incorrectly? If you already know it then there … | |
I want to create a program that reads some data from a specified .txt source file (this part is absolutely no problem) and then write that data to the currently active/open file (something like copy & paste functionality where the copy function reads data from the source file and paste … | |
Re: As I'm sure you noticed when you read the documentation, creating libraries in C++ is very different to C# (in my opinion most things tend to be more difficult in C++). I imagine the complexity in C++ is essentially down to the close-knit relationship between C++ and C (I'm just … | |
So I'm currently working as part of a team that is building a game engine and I have been considering our current code structure. As a team we decided it would be a good idea to create a plugin architecture that allows additional functionality to be added by other users … | |
So for some reason I my brain seems be failing me :( Anyway....I have a cylinder object in 3D space and inside of the cylinder I have line objects originating at the origin (0,0,0) (which is also the centre point of the cylinder). I would like to find the exact … | |
Hey guys, So my Maths has obviously gotten a little rusty and I seem to be struggling with what should be quite simple.... The scenario: I have lines being drawn in 3D space that are calculated using an algorithm. These lines are actually made up of multiple line segments to … | |
Re: If you are planning on using someone else's code for some assignment then you will learn nothing and hopefully be found guilty of plagiarism. Using the code as an analytical reference is a much better idea however. | |
Re: I'm not quite sure what you mean by [QUOTE]how do I keep both the fastest time and startnumber in memory?[/QUOTE] Perhaps you just mean store the data for the duration of the programs execution? The rest is just basic Math. If you know the start and end time then you … | |
Re: Try this: [CODE]string name; cout << endl << "Please enter your first name" << endl << endl; cin >> name; cin.ignore(); string surname; cout << endl << "Please enter your surname" << endl << endl; cin >> surname; cin.ignore();[/CODE] | |
Re: It would be useless to have a virtual constructor in C++. Having a virtual constructor would mean that you could override the class constructor with that of a derived class. Constructors are called at the point of object creation and hence when constructing you cannot be creating a sub-class of … | |
Re: Surely this depends on how you have set up your clipping volume. In OpenGL for example you might call: [CODE]gluPerspective(35.0f, fAspect, 1.0f, 500.0f)[/CODE] If you lowered the value of the last parameter in this instance then it would [B]appear[/B] as though you cannot see as far into the screen. | |
Re: Have you included the necessary header files (I presume the file in which GradeBook is defined) in the main cpp file? Maybe you could post up some code for people to look at? It will make the analysis of your problem much easier | |
Re: As you have declared Queue as follows: [CODE]queue<int> Queue;[/CODE] You cannot simply assign p to it as you are attempting. Looking at your code I see no reason why you don't just assign the values of p directly to the queue (thus removing the need for your struct). e.g. [CODE]Queue[0] … | |
Re: The code you posted here produces a lot more than one error. For example: [CODE]Music::Music(int id){ music[2]=thiskey.display; //this is the error line } }[/CODE] You appear to have an extra '}' and you should do 'thiskey.display()' when calling functions. Also, display is a void function so you aren't even assigning … | |
Re: Could actually post that specific error message please. I presume it says 'undefined reference to *something*' | |
Re: I have found Eclipse and Codeblocks to be quite useful. These are both Open source I believe and run on Linux platforms too :) | |
Re: Look here [CODE]else if (output < tree -> data) { tree -> left = t; cout << "LEFT = " << t -> data << endl; }[/CODE] You are assigning to tree (you root node)......but that's all you ever do. You never move on to the next node. Perhaps if … | |
Re: Maybe you could be a little more specific? For example, what sort of log file are you looking to create? What events? | |
Re: This is very strange....Using the information that you have provided here I have created a working solution; no compilation errors at all (g++ compiler). Do you return from foo? What compiler are you using? | |
Re: Hmm this seems strange but after a little testing with my own code samples I managed to produce the same error (obviously with different files) when I intentionally failed to link with a library that I needed. Perhaps the library that you are linking with has other dependencies. Either that … | |
Re: Linker errors can be quite hard to track down so without any code to examine the job is made ever so slightly more difficult ;) Post up some of the code that you think could be associated to or causing your problems. Side note: Your punctuation and grammar is quite … | |
Re: What specifically are you having trouble with? You just need to create a function or two that will perform the maths calculations exactly as stated. Define a value for PI or use the math header file and then assign the stated value for x and plug it into your functions. … | |
Re: Could you attach (using the advanced editor) the files that you are working with so that I can have a poke around? | |
Re: It's a bit hard to understand what you are saying. If you have compilation errors then it might be useful to post some [B]specific[/B] examples as well as the code that I presume you have now modified | |
Re: Perhaps you should post up the code that you have done so far so that people can actually see what you need help with. You haven't really provided much information to work with | |
Re: Well I guess this depends on whether you are bothered about having to pay for your IDE. I personally spend a large majority of my time programming without an IDE either using vim or gedit. On windows platforms I think Visual studio is a really great IDE and 2010 has … | |
Re: Is this code called in some kind of loop? For example, if this was called as below: [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> #include <iostream> using namespace std; int main(void) { for( unsigned int i = 0; i < 100; i++ ) { srand((unsigned)time(0)); int a; int b; int c; … | |
Re: I could be way off base here but could you not just have a management process of some kind. This process would keep track of the remaining execution time of the currently running process plus those that haven't been executed yet. For each process waiting, the management process could calculate … | |
Re: These forums are designed so that people can provide help and assistance. Have you actually thought about how you could create a solution for your problem yourself? If you have at least made a start then I would be more than willing to help out with any problems that you … | |
Re: I also tried with 4.5.1 and without the include I get compilation errors as I would expect. I will be able to test Visual Studio 2010 a bit later. | |
Re: I believe frogboy is correct. Your loop is decrementing instead of incrementing and hence you are printing the data with the highest index first | |
Re: You will need to include the header file first and then either access the namespaces using the scope resolution operator '::' or add "using namespace /*namespace*/" (which is particularly useful if you will be using the namespace functionality often). | |
Re: Are you actually asking for some help here or just expecting people to do your homework for you? You won't [B]learn[/B] anything if people do all the work for you. If you actually need help with a programming issue and have at least made an attempt to solve your own … | |
Re: Well the ANSI C standard basically tries to encourage better program design so that code produced is nice and portable. You could just do a basic google search for ANSI C and get a ton of information. The first hit I got was [URL="http://en.wikipedia.org/wiki/ANSI_C"]this[/URL]. | |
Re: I've always found DaniWeb to be full of really helpful and friendly people if I was to be honest. I'm pretty sure that there is no standard answer to a question however people don't learn if others do there homework for them. I think maybe this thread should be closed … | |
Re: [QUOTE]We are supposed to minipulate a box in the center of the screen with the input given by a user. The input values given are height and width. How can I create a box in the center of the screen with only two values? [/QUOTE] If the two values provided … | |
Re: If all you wish to find is the number of votes received for whatever then why not simply create counters? e.g. [CODE]int option1 = 0; int option2 = 0; if( /* someone has voted for option1 */ ) option1++; else option2++;[/CODE] | |
Re: The warning seems accurate. I don't think you can simply return an array because what you are doing is (as the warning states) returning the address of buffer. You should perhaps try returning an array pointer? | |
Re: Your post is a bit unclear but I think I get the basic idea. How exactly are you storing the tree items? - Arrays, vector, struct What file information do you actually store? - A series of char/strings Perhaps you could flag the stored items once they are no longer … | |
Re: I agree with Ancient Dragon. Think about how data recovery software works with computers. When files are deleted they get flagged as deleted so that the computer can overwrite the data stored in that area of memory. So long as the memory location hasn't already been re-used the data is … | |
Re: That is entirely dependent upon you. What if you add a word later that exceeds your limit? I would suggest you allocate the memory dynamically so that you don't have to worry about what array size will work best. Anyway, If the largest has 8 characters then you need an … | |
Re: You haven't really provided much information. I presume you just want a basic graphical display to view data; a line graph for example? I would suggest using C++ with OpenGL or a similar API. If you decide to take this option you could pick up the basic skills from nehe … | |
Re: I agree with Fbody, although you don't even appear to have a constructor to use as you are attempting. Surely you would need to actually assign the values that you are passing as parameters? Maybe something more like the following is what you are attempting? e.g. [code=cpp]class SomeObject { private: … | |
Re: Hmmm...It sounds like you are misinterpreting what OpenGL is. Anyway you have to acquire some version of the OpenGL libraries so that you can make use of the API's functionality. This link should be of use to you [url]http://www.opengl.org/resources/libraries/glut/glut_downloads.php#2[/url] | |
So, I have been working on some code with a group of people/organisations etc. and I've hit a small bump in the road that I thought someone on here may be able to help me with :) I have developed some code that draws 3D towers to represent the amount … | |
Ok, so I'm really after knowledge rather than a quick easy solution here. I am part of a team that is currently working on the development of a 'kind of' physics engine but I have hit a small wall since adapting the functionality of a class which was previously working … | |
Hi, Basically I have a game type scenario in which objects are falling from the sky onto uneven terrain below but my problem is this: I can't figure out how to determine when an object has actually collided with a slope (the point of impact) because obviously the y value … | |
Hi, I'm writing a program in C++/OpenGL as part of a university assignment but I am having difficulty using the function glBindTexture to bind my loaded textures onto the models that I load in and render. I can actually wrap the texture around my 3D model no problem but I … | |
Hi, I'm trying to update an objects information within my linked list but for some reason after attempting to alter the data no changes appear to have taken place. As far as I am aware I'm not updating a copy of the object because I am finding the relevant object … | |
Hi, I have created a generic linked list in which different objects can be added to a list as long as they inherit from my object class. My problem is this: I am able to add nodes and find nodes etc. but I can't figure out how to return an … |
The End.