[QUOTE=WeltEnSTurm;39194812]You want orthogonal view.[/QUOTE]
Well, okay, how do I make that with a Lua Entity?
Does anyone know of a good GUI library for SFML? I saw CPGUI, but that's only for 1.6.
[url]http://sfgui.sfml-dev.de/[/url]
I haven't used it before, but it looks like it could be good.
I'm not kidding, I want to find an awesome way to make an awesome Orthogonal camera with Lua.
[editline]12th January 2013[/editline]
Okay, I figured it out, but it says that Ortho does this:
"... Orthographic mode seems to break the screen, no error however."
[editline]12th January 2013[/editline]
I have been told that Orthographic projection does actually work. How do I do that, though?
[code]function Swep:CalcView( PLAYER, PLAYPOS - Y*<Var>, <Angle that faces the world, with background behind the player>, 90--[[FOV]] )
local View = {}
View.Origin=PLAYPOS-Y*<Var>
View.angles=<Angle that faces the world, play in front>
View.fov=90
View.Ortho=true or View.ortho=true
return View
end[/code]
Or rather, how do I make a CalcView that is Orthographic?
Darn, it double posted... D:
[QUOTE=Grayman;39185596]Quoting because we started a new page and I want this issue to get exposure.[/QUOTE]
A few things I noticed while looking at the code:
[cpp]
params.lastPosition = posbull + speed * dt;
[/cpp]
Should be probably
[cpp]
params.lastPosition += posbull + speed * dt;
[/cpp]
In the original code q_world_f_core_next_psi is actually normalized, you should give that a try.
Right now I'm learning about Repositories, and I'm trying to learn how to create a Github repository and use it in Eclipse. I'm really having a hard time getting this to work, I have the extension downloaded in Eclipse. Anybody have some tips or good tutorials on how to do this?
[QUOTE=W00tbeer1;39198463]Right now I'm learning about Repositories, and I'm trying to learn how to create a Github repository and use it in Eclipse. I'm really having a hard time getting this to work, I have the extension downloaded in Eclipse. Anybody have some tips or good tutorials on how to do this?[/QUOTE]
Which plugin specifically did you download?
[QUOTE=esalaka;39198527]Which plugin specifically did you download?[/QUOTE]
Git Repository Exploring
A design question: in Java SWING, should the render class contain jbuttons or should they be held inside the input class (the one that is an action listener etc.)? And should the input class, when it gets a command, relay that to the logic class, or should it just have a boolean such as newGame that is read by the logic class? Currently I have all other things as booleans (such as move keys, etc).
Don't make a separate "input" class; add listeners as anonymous inner classes instead. This class is a great example of this design: [url]https://github.com/ata4/bspsrc/blob/master/src/info/ata4/bspsrc/gui/BspSourceFrame.java#L437[/url]
[URL="http://facepunch.com/showthread.php?t=1239091&p=39197565"]This!![/URL]
You rate me dumb? why? I'm going to re-install the game, but I don't want to lose any of my lua. It is not because of lua, though... at least I don't think so.
Probably a stupid question but how do I access the members of an iterator.
[cpp]
void ShaderProgram::deleteShader(string name)
{
vector<Shader*>::iterator it;
for(it = shaders.begin(); it != shaders.end(); ++it)
{
cout << it->getShaderName() << endl;
}
}
[/cpp]
[quote=compile error]
request for member 'getShaderName' in '* it.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator-><Shader**, std::vector<Shader*> >()', which is of pointer type 'Shader*' (maybe you meant to use '->' ?)
[/quote]
Also if anyone could explain to me the difference between a const and non-const iterator and where they should be used that would also be great.
[QUOTE=Chryseus;39204905]Probably a stupid question but how do I access the members of an iterator.
[cpp]
void ShaderProgram::deleteShader(string name)
{
vector<Shader*>::iterator it;
for(it = shaders.begin(); it != shaders.end(); ++it)
{
cout << it->getShaderName() << endl;
}
}
[/cpp]
Also if anyone could explain to me the difference between a const and non-const iterator and where they should be used that would also be great.[/QUOTE]
Oh, it should be (*it)->getShaderName().
[QUOTE=Chryseus;39204905]Probably a stupid question but how do I access the members of an iterator.
[cpp]
void ShaderProgram::deleteShader(string name)
{
vector<Shader*>::iterator it;
for(it = shaders.begin(); it != shaders.end(); ++it)
{
cout << it->getShaderName() << endl;
}
}
[/cpp]
Also if anyone could explain to me the difference between a const and non-const iterator and where they should be used that would also be great.[/QUOTE]
(*it)->getShaderName()
ninja'd
[QUOTE=Chryseus;39204905]Probably a stupid question but how do I access the members of an iterator.
void ShaderProgram::deleteShader(string name){ vector<Shader*>::iterator it; for(it = shaders.begin(); it != shaders.end(); ++it) { cout << it->getShaderName() << endl; }}
Also if anyone could explain to me the difference between a const and non-const iterator and where they should be used that would also be great.[/QUOTE]
(*it)->getShaderName()
late
Thanks guys!
I'm really frustrated right now with python and Lists. I need to pass a list of lists by value.
Normally to do this you do:
[code]
a = [1,2]
a = b #this is by reference
a[0] = 5
print b
[5,2] #should happen
c = a[:] #makes it pass by value
c[0] = 1
print c
[1,2]
print a
[5,2]
[/code]
but with a 2D list / list of lists:
[code]
a = [[5],[2]]
c = a[:] #should make it pass by value
c[0][0] = 1
print c
[[1],[2]]
print a
[[1],[2]]
[/code]
I've tried
c = a[:][:]
c = list(a[:])
and it still doesn't work
i don't know what to do :(
[editline]13th January 2013[/editline]
It's really weird because if I do c = 1 after it won't change a but if I do c[0][0] = 1 it will still change a, I'm guessing it's passing the lists in the list as a reference still, but the list containing those is new?
[editline]13th January 2013[/editline]
I could do:
[code]
for i in range(0, len(a)):
b.append(a[i][:])
[/code]
or something similar, but that seems really silly.
[editline]13th January 2013[/editline]
confirming that the above works but there's surely a way to do this in one line
[QUOTE=Shadaez;39209616]I'm really frustrated right now with python and Lists. I need to pass a list of lists by value.
Normally to do this you do:
[code]
a = [1,2]
a = b #this is by reference
a[0] = 5
print b
[5,2] #should happen
c = a[:] #makes it pass by value
c[0] = 1
print c
[1,2]
print a
[5,2]
[/code]
but with a 2D list / list of lists:
[code]
a = [[5],[2]]
c = a[:] #should make it pass by value
c[0][0] = 1
print c
[[1],[2]]
print a
[[1],[2]]
[/code]
I've tried
c = a[:][:]
c = list(a[:])
and it still doesn't work
i don't know what to do :(
[editline]13th January 2013[/editline]
It's really weird because if I do c = 1 after it won't change a but if I do c[0][0] = 1 it will still change a, I'm guessing it's passing the lists in the list as a reference still, but the list containing those is new?
[editline]13th January 2013[/editline]
I could do:
[code]
for i in range(0, len(a)):
b.append(a[i][:])
[/code]
or something similar, but that seems really silly.
[editline]13th January 2013[/editline]
confirming that the above works but there's surely a way to do this in one line[/QUOTE]
Check out Python's copy module: [url]http://docs.python.org/2/library/copy.html[/url]
copy.copy(a) would return a copy of list a but not the lists inside of it, but copy.deepcopy(a) would return a copy of list a and all lists inside it.
I'm just using the for loop in a method then, thanks, though!
I'm using Visual Basic, and I'm having some trouble finding out how to perform an action when the user exits the program through the red X button. I have a simple .txt file that logs the events of the program, and I want it to plop a specific string in there when the user exits the program. I can't seem to find a way to do this on the program exit, it seems.
[editline]14th January 2013[/editline]
Oops, nevermind. Finally found an MSDN topic on it.
[url]http://msdn.microsoft.com/en-us/library/system.windows.forms.form.closing.aspx[/url]
Does anyone know where can I find an example C++ program that makes use of all or almost all language features?
I'm writing a compiler and I need something to test it against.
[QUOTE=Nikita;39212508]Does anyone know where can I find an example C++ program that makes use of all or almost all language features?
I'm writing a compiler and I need something to test it against.[/QUOTE]
I remember this post from like a year ago, is this the first time you've posted this?
[QUOTE=Nikita;39212508]Does anyone know where can I find an example C++ program that makes use of all or almost all language features?
I'm writing a compiler and I need something to test it against.[/QUOTE]
Try some libraries, like boost for example. I'm pretty sure boost uses many nifty corner cases of many features.
[QUOTE=Nikita;39212508]Does anyone know where can I find an example C++ program that makes use of all or almost all language features?
I'm writing a compiler and I need something to test it against.[/QUOTE]
You're writing a C++ compiler?
Dear God
[QUOTE=Nikita;39212508]Does anyone know where can I find an example C++ program [B]that makes use of all or almost all language features[/B]?
I'm writing a compiler and I need something to test it against.[/QUOTE]
Do you really need that? No compilers out right now actually support all of C++, so it seems to me that even the most trivial of programs would be a challenge to compile for any home made compiler.
Well I've got too much time on my hands so why not :v:
[QUOTE=Nikita;39218765]Well I've got too much time on my hands so why not :v:[/QUOTE]
[url=http://yosefk.com/c++fqa/web-vs-c++.html#misfeature-2]Have fun figuring that shit out[/url]
STL should be good enough for testing the compiler.
Figured I might as well as give [URL="http://www.facepunch.com/showthread.php?p=39174753#post39174753"]my issue[/URL] one more try on a new page. I should also point out that this issue relates to the rotation of the object only.
Does anyone have any ideas? Am I calculating the delta quaternion wrong, or converting it to a vector wrong?
Sorry, you need to Log In to post a reply to this thread.