[QUOTE=Chris220;34801583]Look into Voronoi diagrams.
[editline]21st February 2012[/editline]
[url]http://en.wikipedia.org/wiki/Voronoi_diagram[/url][/QUOTE]
Can this be extend to a 3D environment?
Just curious
well... actually ... I imagine it would be able to.
[QUOTE=-Kesil-;34801700]Can this be extend to a 3D environment?
Just curious
well... actually ... I imagine it would be able to.[/QUOTE]
Yep, theoretically you can extend it to any spatial dimension!
[QUOTE=-Kesil-;34801700]Can this be extend to a 3D environment?
Just curious
well... actually ... I imagine it would be able to.[/QUOTE]
Delaunay triangulation?
It's a method for generating a mesh from a point cloud where each cell gets a vertex and adjacent cells are connected to form polygons.
[QUOTE=ROBO_DONUT;34801756]Delaunay triangulation?
It's a method for generating a mesh from a point cloud where each cell gets a vertex and adjacent cells are connected to form polygons.[/QUOTE]
I think Chris covered it.
The points themselves aren't vertices. I need vertices around these points though.
I'll explain later
I've been trying to make a map system similar to that of Dungeon Keeper 2's, and I'm trying (In XNA 4.0) to do so by having it read a picture, and determine material based on pixel color. But I've been unable to learn how to do this, and I've already exhausted RB Whitaker, Riemers, and Learning XNA 4.0 by Aaron Reed. Any help would be appreciated.
If I'm looking to just create a simple program that you select an item through drop down boxes and it generates a code based on those selections, would C++ be an appropriate choice?
I'm also taking Computing->Computer Science at A Level, so would C++ help me there too?
If so, what's a good compiler for C++?
[QUOTE=SataniX;34803652]If I'm looking to just create a simple program that you select an item through drop down boxes and it generates a code based on those selections, would C++ be an appropriate choice?
I'm also taking Computing->Computer Science at A Level, so would C++ help me there too?
If so, what's a good compiler for C++?[/QUOTE]
If you did this through something like wxWidgets, it might work. Generally, dealing with the win32 api is not fun.
For applications that need to use the Windows Controls etc, I'd use a .NET language (eg C#)
[QUOTE=SataniX;34803652]If I'm looking to just create a simple program that you select an item through drop down boxes and it generates a code based on those selections, would C++ be an appropriate choice?
I'm also taking Computing->Computer Science at A Level, so would C++ help me there too?
If so, what's a good compiler for C++?[/QUOTE]
Disregarding all the other stuff, and heading for the compiler question.
You'll probably want to use GCC or Clang.
So, let's say I have a C++ program. In this case, an interpreter, specifically Lisp.
In this case it goes through the usual read-eval-print loop. Sometimes, exceptions will be thrown.
Sometimes, these exceptions will be deep within several degrees of nesting, and will require the code above them to have other error-handling facilities of its own and what not.
Suppose I make an error-handling system that allows the program to "unwind" the stack (Even though this is not represented explicitly in the interpreter) and go all the way up to the level of the REPL? Something like "Quit every function up until you hit this", or simply "Quit through everything" and then add a restart on top that resets the REPL. Is there some generic way to quit like this, or do I have to roll my own?
[code]def Binary_Conversion(number):
out = ""
power = 15
while power > 0:
if number >= 2^power:
number=number - 2^power
out = out + "1"
power = power - 1
else:
out = out + "0"
power = power - 1
print power
return out
number = input("Enter number")
print Binary_Conversion(number)
print "MallocNull is a gay"[/code]
Help I'm using python and on top of that I can't do python. I made a much better version of this in TI-BASIC during Chem class no problem, but python had to go and fuck it all up.
[QUOTE=Eudoxia;34810724]So, let's say I have a C++ program. In this case, an interpreter, specifically Lisp.
In this case it goes through the usual read-eval-print loop. Sometimes, exceptions will be thrown.
Sometimes, these exceptions will be deep within several degrees of nesting, and will require the code above them to have other error-handling facilities of its own and what not.
Suppose I make an error-handling system that allows the program to "unwind" the stack (Even though this is not represented explicitly in the interpreter) and go all the way up to the level of the REPL? Something like "Quit every function up until you hit this", or simply "Quit through everything" and then add a restart on top that resets the REPL. Is there some generic way to quit like this, or do I have to roll my own?[/QUOTE]
since you're using c++, just use exceptions
[QUOTE=theseltsamone;34812535][code]def Binary_Conversion(number):
out = ""
power = 15
while power > 0:
if number >= 2^power:
number=number - 2^power
out = out + "1"
power = power - 1
else:
out = out + "0"
power = power - 1
print power
return out
number = input("Enter number")
print Binary_Conversion(number)
print "MallocNull is a gay"[/code]
Help I'm using python and on top of that I can't do python. I made a much better version of this in TI-BASIC during Chem class no problem, but python had to go and fuck it all up.[/QUOTE]
In Python (as with most languages) '^' represents the binary XOR function, so '2^15' is interpreted as 'XOR the values of 2 and 15'. To raise a base to a power in Python use '**', for example '2**15' would result in the number 32768.
[editline]22nd February 2012[/editline]
Also, a good starting place for Python documentation is [url]http://python.org/doc[/url]
So I started working with the blackberry native sdk, and I am using c, its a bit of a switch for me since I normally use c++.
I have a array of pointers to images to which I add images to draw on the screen, when I pass the image to the AddImage function it shows their correct values in the debugger but then when I call my DrawImages function the image hash random giberish in it.
Code :
[code]
Image ** images;
unsigned int numImages, numAllocatedImages;
int AddImage(Image * img)
{
if(numAllocatedImages == numImages)
{
numAllocatedImages *= 2;
void *temp = realloc(images, (numAllocatedImages * sizeof(Image*)));
if (!temp)
{
fprintf(stderr, "ERROR: Couldn't realloc memory!\n");
return EXIT_FAILURE;
}
// Things are looking good so far
images = (Image**)temp;
}
images[numImages] = img;
numImages++;
return EXIT_SUCCESS;
}
void init()
{
//Initialize num images :
numImages = 0;
numAllocatedImages = 2;
images = malloc(numAllocatedImages * sizeof(Image*));
//Add a image
Image image;
LoadImage("app/native/happy_face.png", &image);
if(AddImage(&image) == EXIT_FAILURE)
{
return EXIT_FAILURE;
};
}
void DrawImages()
{
//Render background quad first
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
int i;
for(i = 0; i < numImages; i++)
{
DrawImage(images[i]);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_TEXTURE_2D);
}
[/code]
Anybody got any idea why its spitting out the random giberish when I try to draw them ?
I need help with knowing what the fuck to do. I just don't get how people know how to use all this stuff. Like importing all the various things, knowing what to do, what methods they have. I'm trying to make a simple program where you can make a ball move up, down, left or right in a screen and I'm having trouble with that
[QUOTE=Over-Run;34817627]I need help with knowing what the fuck to do. I just don't get how people know how to use all this stuff. Like importing all the various things, knowing what to do, what methods they have. I'm trying to make a simple program where you can make a ball move up, down, left or right in a screen and I'm having trouble with that[/QUOTE]
What language are you using?
[QUOTE=ArchColossus;34817658]What language are you using?[/QUOTE]
Started Java last year in College, and beginning C++ this year, but Java is my main one. I just can't get my head around how people know where and when to use this stuff. Like every tutorial I look at they pull more things out of nowhere. I just sort of got to grips with getting a basic GUI, but then theres so much other stuff I just don't know. Makes me loose motivation.
[QUOTE=Over-Run;34818056]I just sort of got to grips with getting a basic GUI[/QUOTE]
Don't start with UI? Nobody likes UI work. It's tedious and stupid, and most of the time you have your face buried in the API reference for your widget toolkit.
Oh I'm not starting with it. This is my second year of Computer Science, and the programming aspect is my weakest. I can do basic stuff. I was just trying to learn GUI stuff.
What would you suggest?
In a 2D sidescroller with gravity, what would I multiply with dt for lag compensation?
[QUOTE=Darkwater124;34818539]In a 2D sidescroller with gravity, what would I multiply with dt for lag compensation?[/QUOTE]
Everything
Do something fun? Whatever interests you, really.
I'm pretty sure the first recommendation from anyone here is going to be games, but you've got plenty of choices.
You could do web development with any language and FCGI, which involves writing a handler that spits out some HTML for a given URL (or other HTTP header info, like GET/POST, etc.). The simplest "hello world" doesn't have to be more than like 10 lines.
You could start working on an interpreter for mathematical expressions, which involves parsing plaintext into tokens and building an expression tree (or code for a stack machine). This is more involved, but the advantage here is that you can practice programming without having to worry about external libraries. Everything can be done with primitive types and basic I/O.
You could make a simple visual demo with Lua+LOVE or Processing, or you could build a robot with an Arduino and program it to follow lines or avoid obstacles.
[QUOTE=ROBO_DONUT;34818169]Don't start with UI? Nobody likes UI work. It's tedious and stupid, and most of the time you have your face buried in the API reference for your widget toolkit.[/QUOTE]
I just dumped a GUI project for sleep pattern analysis considering the bulk of it was screwing with wxWidgets and whatnot to add/remove/edit entries, while I already have a human readable and editable file format used to store patterns. In fact, one that resembles my sleep diary.
[QUOTE=Darkwater124;34818539]In a 2D sidescroller with gravity, what would I multiply with dt for lag compensation?[/QUOTE]
You're actually doing integration, so it helps to know a little bit of calculus to work with the classical mechanics.
Velocity is the derivative of position, and acceleration is the derivative of velocity (second derivative of position).
Using the most basic approximation (Euler integration):
[i][b]v(t) = a(t) * Δt[/b]
[b]x(t) = v(t) * Δt[/b] = a(t) * (Δt)[sup]2[/sup] / 2[/i]
There are, of course, multiple methods of integration, each with their own advantages and disadvantages. Two other popular methods are RK4 and Verlet.
[QUOTE=ROBO_DONUT;34818650]Do something fun? Whatever interests you, really.
I'm pretty sure the first recommendation from anyone here is going to be games, but you've got plenty of choices.
You could do web development with any language and FCGI, which involves writing a handler that spits out some HTML for a given URL (or other HTTP header info, like GET/POST, etc.). The simplest "hello world" doesn't have to be more than like 10 lines.
You could start working on an interpreter for mathematical expressions, which involves parsing plaintext into tokens and building an expression tree (or code for a stack machine).
You could make a simple visual demo with Lua+LOVE or Processing, or you could build a robot with an Arduino and program it to follow lines or avoid obstacles.[/QUOTE]
Where would be the best place to start learning that stuff? Any recommended tutorials or anything? I was looking at LOVE earlier on and it looks pretty cool. Mainly what I will want to be doing when I finish college will be trying to make games, so I will have to try get good at it. I just don't know where I should be starting with it all, since my college course isn't about making games.
The [url=https://love2d.org/wiki/Main_Page]Wiki[/url] seems to have a lot of good information.
I've never used LOVE2D before, but it seems to be your typical framework, where you fill in a few callback functions that run when specific events occur. They've got a 'love.load', which, I'm guessing is your run-once initialization routine, 'love.update', which appears to be where you'd put your logic for whenever a game frame 'ticks', and 'love.draw', which would be called when the display wants a new image.
They have a bunch of tutorials there, which seem to be arranged alphabetically rather than by complexity. [url=https://love2d.org/wiki/Tutorial:Hamster_Ball]This one[/url] seems to be the simplest.
See all this framework stuff confuses me. I'm not too sure what they are. Like I always hear about XNA and all this sort of framework stuff but I don't know what or how to use them. We haven't been shown it in college so I'm sort of at a loss for what they are.
Thanks for the link I'll have a look over the stuff
[QUOTE=Over-Run;34818953]See all this framework stuff confuses me. I'm not too sure what they are. Like I always hear about XNA and all this sort of framework stuff but I don't know what or how to use them. We haven't been shown it in college so I'm sort of at a loss for what they are.
Thanks for the link I'll have a look over the stuff[/QUOTE]
Frameworks and libraries are similar in that they are both collections of reusable code, but the difference is that a framework dictates structure to some degree, whereas a library merely provides you with some routines for you to use however you wish. A framework will typically override the usual entry-point (if there is one, like "int main()" in C) and, instead, gives the programmer some callback functions or handlers to fill-in to specify behavior. The framework does what it needs to do (all the simple boilerplate stuff), but references your code in places where any major decisions are to be made.
Oh right I see, cheers.
I just downloaded LOVE. Trying it now, not too sure how to actually run the program. I just copied the Hamster game code to see if I could work it, no luck yet
EDIT
Never mind, just got it there. going to play around in it now. Thanks.
EDIT
Man, even though it's so simple, LOVE is so fucking cool. I'm in love.
I just tried that Hamster program, but how would I get it so I can have 2 hamsters controlled by different keys? I have gotten 2 hamsters to print on in different areas on the screen, but I'm not sure how to make the second one move by different keys. I copied the function to make the first move and changed the variables to the corresponding ones for the second hamster but I can't get it working.
This is supposed to print the largest string in the vector, but it seems to be printing random strings in the vector instead:
[cpp]#include <iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
using std::cin;
using std::cout;
using std::endl;
using std::sort;
using std::streamsize;
using std::string;
using std::vector;
int main()
{
cout << "Enter followed by ctrlz";
vector<string> vec;
string x;
while (cin >> x)
vec.push_back(x);
cout << endl;
typedef vector<string>::size_type vec_sz;
vec_sz size = vec.size();
sort(vec.begin(), vec.end());
cout << vec[size-1];
system("pause");
return 0;
}[/cpp]
It's working for me. What values are you testing with?
Sorry, you need to Log In to post a reply to this thread.