Karsticles
Member
I am thinking about learning the Unity development system. What is its coding language most similar to, if anyone knows?
Unity will let you use a few different languages: JavaScript, C#, and Boo.
Is the opposite also true? I'm learning Java; will Unity be easier to understand once I get to a competent programming level?
Hey guys I'm getting ready to start my computer science classes next fall for a bachelors degree. I have 2 years of school to work through. Haven't decided what I want to specifically do after I finish but any advice on what language(s) I should focus on as a beginner and then build on to hopefully secure a job?
once you get to a competent level in any language it should be easy to pick up another language fairly quickly.
Don't worry about the language too much. Just find out what it is you want to make and try to do it in any language.
Don't worry about the language too much. Just find out what it is you want to make and try to do it in any language.
OK, I figure I will learn the basis for coding through my classes so I was just wondering if I should put a focus on a language but figuring out what it is what I want to do first makes more sense. Thanks.
That way, once you are comfortable you can easily move on to different languages and feel comfortable.
While I'm not familiar with Lynda courses, I suspect these are better sources, and also free.are any of the lynda courses for basic programming in Python or any other language generally alright? or maybe just fundamental logics -- I'm a math major who's done some javascript and python before, but I haven't had any formal instruction with any programming languages outside of high school, so I'm likely beginning at the fundamentals
It doesn't matter what you call the file you put them in. The only thing that matters is that file is #include'd wherever something wants to use a node<T>. I just call those files *.h, but some people like to call them *.hpp.
All compilers require the template definition to be visible where it's used. That's fundamentally part of the language. However, the biggest thing that putting them in separate files gets you is faster compilation speed and less frequent recompilation. It does not really affect the program itself.
Hmm... All I can say is to double-check that the library is in your library path, and that you're specifying it to be linked into your application. Carefully reviewing the actual build commands being given to msvc / link or gcc / ld can help.
On Ubuntu or Fedora Linux, it's enough just to install glew and add '-lGLEW' to the gcc invocation. That might be all mingw needs, though it might not be (due to differences in where things get installed under Windows vs Linux).
QT += core gui
QT += opengl
TARGET = untitled
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
glwidget.cpp
HEADERS += mainwindow.h \
glwidget.h
FORMS += mainwindow.ui
LIBS += -LD:/glew/lib -lglew32s
INCLUDEPATH += D:/glew/include
DEPENDPATH += D:/glew/include
PRE_TARGETDEPS += D:/glew/lib/glew32s.lib
mvpLoc = glGetUniformLocation(program, "MVP");
normLoc = glGetUniformLocation(program, "MatNorm");
in vec3 pos;
in vec3 norm;
in vec2 tex;
uniform mat4 MVP;
uniform mat3 MatNorm;
void main(void)
{
gl_Position = MVP * vec4(pos, 1);
}
money wise Lynda is free for me -- my school provides it. I'm not a fan of udacity or edx courses, and I've used the HTML book on the second site a bit. I'll do that some more, but I'm still wondering if anyone has used Lynda for anything programming I wise.While I'm not familiar with Lynda courses, I suspect these are better sources, and also free.
https://www.udacity.com/course/cs101
http://learnpythonthehardway.org/
I can't recommend ApiTrace enough.This is what my qmake file looks like, note the include path, depend path and library path, my libraries are where you might expect from this.
Code:QT += core gui QT += opengl TARGET = untitled TEMPLATE = app SOURCES += main.cpp mainwindow.cpp glwidget.cpp HEADERS += mainwindow.h glwidget.h FORMS += mainwindow.ui LIBS += -LD:/glew/lib -lglew32s INCLUDEPATH += D:/glew/include DEPENDPATH += D:/glew/include PRE_TARGETDEPS += D:/glew/lib/glew32s.lib
Code:
Since I'm beginning to run out of time I switche dover to developing this on linux in a vm in which I managed to get glew and qt to work together but now I've got new problems
Code:mvpLoc = glGetUniformLocation(program, "MVP"); normLoc = glGetUniformLocation(program, "MatNorm");
both uniforms are ready and waiting in my vertex shader but the second get uniform call returns -1 every time. This is what my vertex shader looks like right now.
Code:in vec3 pos; in vec3 norm; in vec2 tex; uniform mat4 MVP; uniform mat3 MatNorm; void main(void) { gl_Position = MVP * vec4(pos, 1); }
money wise Lynda is free for me -- my school provides it. I'm not a fan of udacity or edx courses, and I've used the HTML book on the second site a bit. I'll do that some more, but I'm still wondering if anyone has used Lynda for anything programming I wise.
Either way I'll be trying Lynda out, hah. Gonna see a few things. Thanks for the resources, though
I have used Lynda's courses for Android development. I thought they were alright.
anyone have any experience with the java ide intellij?
friend was talking about it, seems alright.
I know guys who swear by it. I used it for a short while and the refactoring tools seem really powerful. There's all kinds of shit like automatically creating getters and setters for members but I question how valuable a lot of that is.
anyone have any experience with the java ide intellij?
friend was talking about it, seems alright.
cool, any specific comments?
anyone have any experience with the java ide intellij?
friend was talking about it, seems alright.
alas i don't think what i do classify as open source
gotcha, thanks!Not really. I didn't spend too much time with the courses. They seemed to be pretty similar to just going through the developer site on Google, but in video form.
<FORM>
<input type="text" id="realtxt"/>
<SELECT id="realitems">
<OPTION value="1">
<OPTION value="max">Enter the highest number
<OPTION value="min">Enter the lowest number
<OPTION value="guess">Guess a number
</SELECT>
<button accesskey="v" id="btnVerify" onclick="result()"> Result </button>
</FORM>
function disable()
{
if(document.getElementById("realitems").value === "1")
document.getElementById("btnVerify").disabled = true;
else
document.getElementById("btnVerify").disabled = false;
};
<FORM>
<input type="text" id="realtxt"/>
<SELECT id="realitems" onchange='disable()'>
<OPTION value="1"></OPTION>
<OPTION value="max">Enter the highest number</OPTION>
<OPTION value="min">Enter the lowest number</OPTION>
<OPTION value="guess">Guess a number</OPTION>
</SELECT>
<button accesskey="v" id="btnVerify" onclick="result()"> Result </button>
</FORM>
function disable()
{
var mySelect = document.getElementById('realitems');
if(mySelect.options[mySelect.selectedIndex].value == 1)
{
document.getElementById("btnVerify").disabled = true;
}
else
{
document.getElementById("btnVerify").disabled = false;
}
}
Changing your code:
Code:<FORM> <input type="text" id="realtxt"/> <SELECT id="realitems" onchange='disable()'> <OPTION value="1"></OPTION> <OPTION value="max">Enter the highest number</OPTION> <OPTION value="min">Enter the lowest number</OPTION> <OPTION value="guess">Guess a number</OPTION> </SELECT> <button accesskey="v" id="btnVerify" onclick="result()"> Result </button> </FORM>
Code:function disable() { var mySelect = document.getElementById('realitems'); if(mySelect.options[mySelect.selectedIndex].value == 1) { document.getElementById("btnVerify").disabled = true; } else { document.getElementById("btnVerify").disabled = false; } }
The 'onchange' attribute that I added to the select will call the disable() method whenever it's changed.
Some of the other additions are just so I could test it in jsfiddle. Which you can see here. I didn't deactivate it on the initial page load, too lazy.
Ahh, so it is like an array. In that case, if I want the blank option to disable the button would I then change ==1 to ==0?
if (mySelect.selectedIndex == 0)
if(document.getElementById("realitems").selectedIndex == 0)
that ==1 is the actual value of the option that you set as 'value = 1'.
You could also change the code I wrote to:
or yours to:Code:if (mySelect.selectedIndex == 0)
Code:if(document.getElementById("realitems").selectedIndex == 0)
in order to do what you just suggested.
var mySelect = document.getElementById('realitems');
Declaring
Outside of any functions but within <script></script> should act as a global variable too yes?
#include <iostream>
#include <iomanip>
#include "Node1.h"
using namespace std;
using namespace dijoseph;
template<class Item>
void displayPoly(node<Item>* poly);
template<class Item>
Item solve(node<Item>* poly, Item x);
void description(); // Function prototype
void instructions();
template<class Item>
void setPoly(node<Item>*& poly);
int main()
{
// Declaring variables
char menu = 'A';
node<float>* cursor = NULL, *poly2 = NULL, *poly1 = NULL;
float x;
cout << fixed << setprecision(1); // IO Manipulation
description(); // Function call
while (menu != 'X') // Menu loop
{
cout << "\nPlease enter a menu option: ";
cin >> menu;
switch (toupper(menu))
{
case '1': // 1 for displaying the polynomial
if (poly1 != NULL)
{
listClear(poly1);
}
setPoly(poly1);
break;
case '2': // 2 for setting the coefficients of the polynomial
displayPoly(poly1);
break;
case '3': // 3 for erasing the coefficients of the polynomial
if (poly1 != NULL)
{
listClear(poly1);
}
setPoly(poly1);
if (poly2 != NULL)
{
listClear(poly2);
}
setPoly(poly2);
displayPoly(multiplyPoly(poly1, poly2));
break;
case '4': // 4 for adding two polynomials
if (poly1 != NULL)
{
listClear(poly1);
}
cout << "Poly has been erased" << endl;
break;
case '5': // 5 for solving the polynomial for a value of x
cout << "Enter a value for x: ";
cin >> x;
cout << "The poly resolves to " << solve(poly1, x) << endl;
break;
case 'H': // H for instructions on how to properly enter the coefficients of polynomials
instructions();
break;
case 'X':
exit(1); // Exits program
default:
cout << "Invalid entry" << endl; // Error handling
}
}
return 0;
}
A large portion of things you have to use to get things done in C is bad style in C++ code. If C++ is what you want to write, learning C first is a total waste of time. If you keep going with C++ you'll learn all the same things eventually but from a better context.Which philosophy of learning c++ do you guys agree with more and why? the learn C, then slowly transition to C++ style, or the learn c++ straight up style? Thinking of getting C++ Primer to replace my C++ primer plus book which is based on the former style and use that to read up and self teach myself more C++ over the summer.
Is there a way to change node<float> to something generic, and then request the data type from the user?
A large portion of things you have to use to get things done in C is bad style in C++ code. If C++ is what you want to write, learning C first is a total waste of time. If you keep going with C++ you'll learn all the same things eventually but from a better context.
projection = perspective(fov, aspect, 0.01f, 10.0f);
view = lookAt(eye, vec3(0.0f,0.0f,0.0f), up);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glClearDepth(1.0f);
//input position
in vec3 pos;
//input vertex normal
in vec3 norm;
//TODO texCoord, bitangent, tangent
//output to fragment shader
varying vec3 normal;
varying vec3 lpos;
varying vec3 fpos;
//modelview matrix
uniform mat4 MV;
//projection matrix
uniform mat4 P;
//normal transform matrix
uniform mat3 NML;
//TODO height, normal, albedo, gloss textures
//TODO define and control light on c++ side
void main(void)
{
//eye space transformation
fpos = (MV * vec4(pos,1.0f)).xyz;
//hard-coded light position for now
lpos = (MV * vec4(2.0f,2.0f,0.0f,1.0f)).xyz;
normal = NML * norm;
//project eye space vertex
gl_Position = P * vec4(fpos,1.0f);
}
I've managed to solve all of the previous issues I've had with my openGL project but now all of my objects have a gl_FragColor.z value of 1, aka their depth is 1.0f, aka maximum depth which means they are not working correctly.
My initialization of depth testing and matrices wherein nothing is displayed
Code:projection = perspective(fov, aspect, 0.01f, 10.0f); view = lookAt(eye, vec3(0.0f,0.0f,0.0f), up); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glClearDepth(1.0f);
changing the depth function from less to less than or equal to causes everything to be displayed, without the benefit of depth testing of course. Likewise an examination of gl_FragColor.z in the fragment shader confirms every fragment has 1.0f
of course I also call glClear in my rendering function to clear the depth back to 1.0
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
Im using glm for my matrix generation and as far as I can tell i'm using it correctly. My trackball rotation works correctly and all the perspective transformations are correct.
vertex shader
Code://input position in vec3 pos; //input vertex normal in vec3 norm; //TODO texCoord, bitangent, tangent //output to fragment shader varying vec3 normal; varying vec3 lpos; varying vec3 fpos; //modelview matrix uniform mat4 MV; //projection matrix uniform mat4 P; //normal transform matrix uniform mat3 NML; //TODO height, normal, albedo, gloss textures //TODO define and control light on c++ side void main(void) { //eye space transformation fpos = (MV * vec4(pos,1.0f)).xyz; //hard-coded light position for now lpos = (MV * vec4(2.0f,2.0f,0.0f,1.0f)).xyz; normal = NML * norm; //project eye space vertex gl_Position = P * vec4(fpos,1.0f); }
Is it possible it's not doing perspective division on its own?
I have a somewhat rudimentary problem right now with HTML and JS. While I know how to disable a button, I'm not sure on how to make it conditional.
Right now I've got a form.
Code:<FORM> <input type="text" id="realtxt"/> <SELECT id="realitems"> <OPTION value="1"> <OPTION value="max">Enter the highest number <OPTION value="min">Enter the lowest number <OPTION value="guess">Guess a number </SELECT> <button accesskey="v" id="btnVerify" onclick="result()"> Result </button> </FORM>
Disabling the button in JS:
Code:function disable() { if(document.getElementById("realitems").value === "1") document.getElementById("btnVerify").disabled = true; else document.getElementById("btnVerify").disabled = false; };
What I'm assuming is that the value of select is determined by the OPTION value of whatever is chosen in the dropdown menu. If that's true then what I need to make happen those is to execute the JS function in <SELECT> but I'm not sure on how to add the function to it.
in vec3 pos;
in vec3 normal;
in vec2 texCoord;
in vec3 tangent;
//modelview matrix
uniform mat4 MV;
//projection matrix
uniform mat4 P;
//normal transform matrix
uniform mat3 NML;
//output to fragment shader
out vec3 fNormal;
out vec3 light_pos;
out vec3 fPos;
out vec2 fTexCoord;
void main(void)
{
[B] gl_Position = P * MV * vec4(pos,1);
fNormal = NML * normal;
vec3 ohMyGodIBrokeIt = cross(normal, tangent);
light_pos = (MV * vec4(2, 2, 0, 1)).xyz;
fPos = (MV * vec4(pos,1.0f)).xyz;
fTexCoord = texCoord;
[/B] //project eye space vertex
}
gl_Position = P * MV * vec4(pos,1);
fNormal = NML * normal;
light_pos = (MV * vec4(2, 2, 0, 1)).xyz;
fPos = (MV * vec4(pos,1.0f)).xyz;
fTexCoord = texCoord;
[B] vec3 ohMyGodIBrokeIt = cross(normal, tangent);
[/B]
[B] fNormal = NML * normal;
[/B] gl_Position = P * MV * vec4(pos,1);
light_pos = (MV * vec4(2, 2, 0, 1)).xyz;
fPos = (MV * vec4(pos,1.0f)).xyz;
fTexCoord = texCoord;
vec3 ohMyGodIBrokeIt = cross(normal, tangent);
All these Bitcoin exchanges using MongoDB or some other non ACID complaint DBs.
You would think these programmers would know better.
Just finished one of my last programming assignments for this semester and i'm pretty damn happy.
The assignment might seem easy to some of you expert programmers but i'm just glad I got through it.
Ah, the program I'm taking at my college uses the philosophy of learning C and then learn c++, but slowly transition to using c++ OO tools. We're still using c style null terminated strings exclusively in my C++ class.
Hahaaaaaaaaaaaaaaaa I've lost the plot, my vertex shader is apparently spitting out random crap to my fragment shader dependent on... order of instructions
.../snip...
THIS
gives a properly textured and lit cube.Code:gl_Position = P * MV * vec4(pos,1); fNormal = NML * normal; light_pos = (MV * vec4(2, 2, 0, 1)).xyz; fPos = (MV * vec4(pos,1.0f)).xyz; fTexCoord = texCoord; [B] vec3 ohMyGodIBrokeIt = cross(normal, tangent); [/B]
THIS
Code:[B] fNormal = NML * normal; [/B] gl_Position = P * MV * vec4(pos,1); light_pos = (MV * vec4(2, 2, 0, 1)).xyz; fPos = (MV * vec4(pos,1.0f)).xyz; fTexCoord = texCoord; vec3 ohMyGodIBrokeIt = cross(normal, tangent);
Causes no vertices to be drawn.