[QUOTE=esalaka;39134126]NP++ isn't an IDE tho.
(Also there's Geany too if you're not a KDE person)[/QUOTE]
Indeed, it's not an IDE, but it still does the trick. (C++ IDEs are mostly just file editing anyways.)
Also, it's lightweight.
[QUOTE=Lord Fear;39134964]Ports shouldn't really be blocked within the LAN unless manually done. Are you using TCP or UDP?[/QUOTE]
UDP
[QUOTE=WTF Nuke;39135132]UDP[/QUOTE]
Is both the sender and receiver using the same ports? Have you put in the right IP? Have you unblocked the game from the firewalls? (on both computers and this includes windows firewall)
Does it work when sending to and from the same computer (localhost)?
Yes yes no yes. I can't edit the firewall, the thing that confuses me is that other games work.
[QUOTE=luavirusfree;39134823]Mkays, t-thank-thou.!
Uhm, how would I write that? "theta = arccos(a.b/|a||b|) where a and b are the normal and direction."
colang=arccos(normal.dir/|normal||dir|
??? ???[/QUOTE]
You'll want to brush up on maths if you plan to do more 3d anything. a.b means the dot-product of the vectors a and b, |a| means the magnitude (length) of the vector a.
I'm sorry, its just that I've had a traumatic brain injury since I learned most of my math (roughly at the middle of last year...), but I'm going to college, soon, for the first time... because I'm only 18.
[editline]7 January 2013[/editline]
[URL="http://www.facepunch.com/showthread.php?t=1237962&p=39134461"]I only want help here because last time[/URL], the only helper I had got banned for reasons I don't know, but not because of the help... .
[QUOTE=Spero78;39135007]So ive been programming a TCP server in PHP but i've been looking to redo it in another language, i was looking at node / ruby, what would you people suggest? I couldn't find any good guides for setting up ruby on osx for application development, there are plenty for rails but i don't want that. Node seems pretty good but id rather not use javascript. Any suggestions are welcome[/QUOTE]
Get RVM or chruby, install the latest stable (ruby-1.9.3-p363) or the latest preview release if you feel like living on the edge (ruby-2.0.0-rc1, which is actually pretty stable)
Then you're done. Maybe install pry if you feel like using a better REPL than irb.
Anyone know of a good or not awful online school with a CS related degree option? My local community college's CS program is awful (I took one class and it was just bad), and would like to go back to school. The only other options in the area are quite far away.
Does anyone know if gzip or DEFLATE support concatenation of compressed data?
I have a resource R which is static, so I can store the compressed R. However I don't need the resource on its own; I need P + R + Q where P and Q are some data I can't store. Is there a way to speed up calculating C(P+R+Q) by calculating C(R)?
[QUOTE=WTF Nuke;39135363]Yes yes no yes. I can't edit the firewall, the thing that confuses me is that other games work.[/QUOTE]
The firewall could be blocking the server from recieving. And why can't you edit the firewall?
[QUOTE=swift and shift;39140142]Get RVM or chruby, install the latest stable (ruby-1.9.3-p363) or the latest preview release if you feel like living on the edge (ruby-2.0.0-rc1, which is actually pretty stable)
Then you're done. Maybe install pry if you feel like using a better REPL than irb.[/QUOTE]
Yeah i just installed RVM and 1.9.3, i was getting confused with all the rails talk about generating projects and over complicating it in my head, Then realized that you just run a .rb file from terminal to run your applications.
Thanks for the help
Do I need to define a shader's output to a buffer every time I change a shader?
also do I need to make a rotation and scale shader? It seems all the shader swapping will cost a lot in the long.
[QUOTE=chaoselite;39146818]Do I need to define a shader's output to a buffer every time I change a shader?
also do I need to make a rotation and scale shader? It seems all the shader swapping will cost a lot in the long.[/QUOTE]
You should be defining a fragment shader's output variable location only once, before linking the program with [url=http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocation.xml]glBindFragDataLocation[/url], unless you're talking about something else...
Also, all transformations, including rotation and scale, are handled by matrices instead of separate shaders. You should read up a bit more on shaders to get a better understanding of what they're for and how to use them. This example includes a very basic shader program (consisting of a vertex shader and a fragment shader) and the code you should be calling to get it drawn on screen: [url]http://www.lighthouse3d.com/cg-topics/code-samples/opengl-3-3-glsl-1-5-sample/[/url]
[QUOTE=Shadaez;39140199]Anyone know of a good or not awful online school with a CS related degree option? My local community college's CS program is awful (I took one class and it was just bad), and would like to go back to school. The only other options in the area are quite far away.[/QUOTE]
Just curious, what made the CS class awful? What did you expect to be taught that wasn't and remember it was only the [b]first[/b] class. Also was it free?
Can someone help me with a tiny error? Im trying to make a very simple exponential growth console application to do my homework, but the answer is wrong for every calculation. I think it has to do with the me not knowing how to properly implement exponents into an equation.
[CPP]
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float inAmount, rate, periods, fiAmount;
cout << "Please input the inital amount. \n";
cin >> inAmount;
cout << "Please input the growth rate in a decimal percent. \n";
cin >> rate;
cout << "Please input the number of growth periods. \n";
cin >> periods;
fiAmount = inAmount(1+rate)*pow(rate, periods);
cout << "The answer is: " << fiAmount << endl;
system("PAUSE");
return 0;
}
[/cpp]
[QUOTE=robmaister12;39149136]You should be defining a fragment shader's output variable location only once, before linking the program with [url=http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocation.xml]glBindFragDataLocation[/url], unless you're talking about something else...
Also, all transformations, including rotation and scale, are handled by matrices instead of separate shaders. You should read up a bit more on shaders to get a better understanding of what they're for and how to use them. This example includes a very basic shader program (consisting of a vertex shader and a fragment shader) and the code you should be calling to get it drawn on screen: [url]http://www.lighthouse3d.com/cg-topics/code-samples/opengl-3-3-glsl-1-5-sample/[/url][/QUOTE]
I have a hard time seeing what vertex shaders are used for. I understand what fragment is used for like lighting, texturing and the sorts, but not vertex.
[QUOTE=Shirky;39149583]Can someone help me with a tiny error? Im trying to make a very simple exponential growth console application to do my homework, but the answer is wrong for every calculation. I think it has to do with the me not knowing how to properly implement exponents into an equation.
[CPP]
fiAmount = inAmount(1+rate)*pow(rate, periods);
}
[/cpp][/QUOTE]
I think you mean:
[cpp]fiAmount = inAmount * pow(1 + rate, periods);[/cpp]
[QUOTE=chaoselite;39149741]I have a hard time seeing what vertex shaders are used for. I understand what fragment is used for like lighting, texturing and the sorts, but not vertex.[/QUOTE]
You provide vertices in local coordinates. OpenGL has no notion of your coordinate space, so you need to convert your vertices to something OpenGL does understand, [url=http://www.opengl.org/archives/resources/faq/technical/transformations.htm]Clip Coordinates[/url]. This is basically a cube that goes from [-1, 1] on all 3 axes (that's actually Normalized Device Coordinates, but OpenGL does the clipping)
The vertex shader is how you take your own vertex data and convert it to that standard space. With deprecated OpenGL, this all happened behind the scenes. You'd call glTranslate/Rotate/Scale/gluLookAt with an active matrix of GL_MODELVIEW to create a matrix that coverts your vertices from object space to eye space, you'd also call glOrtho or glPerspective with an active matrix of GL_PROJECTION to create the projection matrix that converts vertices from eye space to clip space. When you draw a triangle with deprecated OpenGL, it would take your vertices and multiply them by the modelview matrix, then by the perspective matrix.
From there OpenGL scales that coordinate system to Window Coordinates and does it's triangle rasterization there. That's when the fragment shader comes into play. The rasterizer determines which pixels are contained in a triangle then figures out what that pixel's color should be. In dperecated OpenGL, that was determined by the currently bound textures, texture coordinates, normals, blend mode, glLight settings, glMaterial settings, etc. In modern OpenGL, it'll invoke the currently bound fragment shader and get a color back from it.
[editline]8th January 2013[/editline]
It's a lot to take in at once and it's pretty complicated, so here's a short version: The vertex shader takes your vertices and "maps" them to a pixel on the screen.
[QUOTE=account;39149975]I think you mean:
[cpp]fiAmount = inAmount * pow(1 + rate, periods);[/cpp][/QUOTE]
Thanks, it worked!
Hey, first time posting in this thread and I was wondering if the form of the code is good and if there can be any optimizations. First time at a proper project.
Edit: Seems the draw function is very intensive with larger grids, is there a better way to draw them if I'm going to replace the rectangles with sprites later on?
[lua]-- Grid Functions go here
-- Creating the grid Table
grid = {}
grid.def = {} -- Keeps all grids in a table
grid.genSize = 20 -- Size of a generic grid in pixels
local id = 0 -- Unique ID
time = 0
function startGrid()
id = id + 1
local main = grid:defineGenericGrid(50,50, 20,20, id, "main") -- Defines a generic grid
grid.def[id] = main
end
function updateGrid(dt)
end
function drawGrid()
grid.draw()
end
function grid:defineGenericGrid(x,y, sx,sy, id, name) -- Creates a generic grid
local defGrid = {} -- Table that is going to be returned
defGrid.baseX = x -- X position of the table
defGrid.baseY = y -- Y position of the table
defGrid.xy = {} -- Table for X properties -- Table for Y properties
defGrid.sx = sx -- Size of the X array
defGrid.sy = sy -- Size of the Y array
defGrid.isGeneric = true
defGrid.totalSize = sy*sx
defGrid.id = id -- Unique ID
defGrid.name = name -- Gives a generic name for all grids of the same type
for i = 1, defGrid.sx do
defGrid.xy[i] = {} -- Creates a Multi Dimensional Array for XY properties
for k = 1, defGrid.sy do
defGrid.xy[i][k] = {}
defGrid.xy[i][k].isUsed = false
defGrid.xy[i][k].color = {255,255,255,255}
end
end
return defGrid
end
function grid:draw()
for i, obj in pairs(grid.def) do -- Gets all grids
local curX = obj.baseX
local curY = obj.baseY
for i = 1, obj.sx do -- Creates a loop for all X axis
for k = 1, obj.sy do -- Creates a loop for all Y axis
love.graphics.setColor(obj.xy[i][k].color)
love.graphics.rectangle("line", curX, curY, grid.genSize, grid.genSize)
curY = curY + grid.genSize
end
curY = obj.baseY
curX = curX + grid.genSize
end
end
end
function grid:checkPointCollision(x,y)
for _, obj in pairs(self.def) do
if obj.isGeneric then -- Checks to see what type of detection to use
maxX = self.genSize * obj.sx + obj.baseX -- Create a Max X pos for AABB collision
maxY = self.genSize * obj.sy + obj.baseY -- Read Above
if x - 2 < obj.baseX or x + 2 > maxX or y - 2 < obj.baseY or y + 2 > maxY then
else
local currentX = x - obj.baseX -- Delta Position
local currentY = y - obj.baseY
currentX = math.ceil(currentX / self.genSize) -- Figure out where the collision was in the array on the X axis
currentY = math.ceil(currentY / self.genSize) -- Figure out where the collision was in the array on the Y axis
for i = 1, obj.sx do
for k = 1, obj.sy do
if i == currentX and k == currentY then
obj.xy[i][k].color = {255,0,0,255} -- !DEBUG! Change color of the array
else
obj.xy[i][k].color = {255,255,255,255} -- !DEBUG! Change color of the array
end
end
end
end
end
end
end[/lua]
[IMG]http://puu.sh/1Lswj[/IMG]
Trying to get a valid variable name and pushing it on the stack as a whole
in a switch statement out of single
characters and using regex and making sure they're pushed on the stack correctly
and pushing numeric values as integers instead of strings - is simply an overkill.
Anybody get a better idea to do something like this?
There needs to be one space between a valid variable name and every other character
Like this:
[IMG]http://puu.sh/1LsFE[/IMG]
[QUOTE=robmaister12;39150030]The vertex shader is how you take your own vertex data and convert it to that standard space[/QUOTE]It also can be used for vertex based lighting which can provide a great performance increase when you have less vertices being processed than fragments, or to simply help do some of the calculations which will be interpolated over when sent to the fragment shader.
[QUOTE=Lord Fear;39140541]The firewall could be blocking the server from recieving. And why can't you edit the firewall?[/QUOTE]
It's on school comps, I guess I can't make it. The firewall is blocking it. Thanks anyway.
[QUOTE=Two-Bit;39149221]Just curious, what made the CS class awful? What did you expect to be taught that wasn't and remember it was only the [b]first[/b] class. Also was it free?[/QUOTE]
turning code in through a word document with code diagrams made with word art basically
[QUOTE=WTF Nuke;39151635]It's on school comps, I guess I can't make it. The firewall is blocking it. Thanks anyway.[/QUOTE]
Then that's your problem. Most school networks has very tight limitations.
Someone just showed me Moonlight Commander, something like Total Commander for Linux. It uses a command line and works with the mouse. How does it capture mouse events?
[QUOTE=Darkwater124;39153661]Someone just showed me Moonlight Commander, something like Total Commander for Linux. It uses a command line and works with the mouse. How does it capture mouse events?[/QUOTE]
NCurses apparently supports mouse. Take a look at [URL="http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html"]this[/URL].
How do I make two global screen size variables in C++? I want to use them across classes.
With the extern keyword. "extern symbol" specifies that the symbol is in some other translation unit. Meaning in another source file, or a library.
[QUOTE=Meatpuppet;39160520]How do I make two global screen size variables in C++? I want to use them across classes.[/QUOTE]Use externs. Just define the variables in a CPP file somewhere and either put this in either a header and include that header when you need it, or put it where needed.
[code]extern int screenx;
extern int screeny;[/code]
Don't forget to use your variable names lol
Sorry, you need to Log In to post a reply to this thread.