• What Do You Need Help With? V6
    7,544 replies, posted
[QUOTE=robmaister12;41782598]Which language? And are you looking for OpenGL bindings or a graphics library built on top of OpenGL?[/QUOTE] C++. I think I need just a graphics library.
[QUOTE=UtraWalrus;41781495]ok thanks for clearing that up! i tried downloading PyDev but i couldn't get eclipse working. do you have any other ide you could recommend for python? i tried vim but it was too overwhelming and confusing for me.[/QUOTE] What exactly is the problem with Eclipse? Vim is (afaik) just a very good text editor, not an IDE. A good IDE will help you learn the language far faster. You may be able to use [URL="https://pytools.codeplex.com/"]Python Tools for Visual Studio[/URL] instead of PyDev, but that most likely requires a commercial VS version. If you're a student you may be able to get it for free, otherwise it's very expensive. Make sure you have the newest Java runtime before installing Eclipse, Eclipse Standard should work out of the box then. [editline]10th August 2013[/editline] When installing Java make sure you avoid the Ask toolbar, if you accidentally agreed to install it I think you can kill the installation process from the task manager. It's delayed a few minutes to avoid immediate uninstallations from the control panel.
Vim is just a text editor? don't know why i thought it was a ide... as for my issues with eclipse yeah it was a java error of some kind. I can't recall what the error was though, but i do have the latest version of java installed. but i did actually ended up getting PyDev from installing Aptana studio 3, all these options are pretty overwhelming though but I'm sure ill make more sense once i learn the language a bit more. and maybe ill give python tools for VS a shot. I installed visual studio express 2012 just in case i ever get around to learning C++ (since i noticed that's the popular language on this forum).
Well, Vim does have a lot of functions IDEs do, they're just... A... well, they're actually nigh-inaccessible unless you've been using vim for long. But it's not like you should ever start off with vim or emacs, anyway. Both require you to start remembering a ridiculous amount of commands just to get the editing going smoothly but when you remember them you'll probably be somewhat more efficient than you would be with just a text area. Vim is just a really complicated text editor but it's complicated in ways that will eventually help you do things faster. Moreover, it was specifically made for programming et cetera so it's certainly not an inappropriate replacement for an IDE. It won't give you decent autocompletion (though there [B]is[/B] an autocomplete function that depends on ctags or equivalent but it's a bit complex) but I never really found myself needing that with languages I knew a bit better. The man (or manual program of choice) integration helps particularly with C. (Can't remember function signature? Just hit K!)
I use VS Vim [url]http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329[/url] It basically lets you use vim inside visual studio. Pretty dandy.
[QUOTE=WTF Nuke;41788370]I use VS Vim [url]http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329[/url] It basically lets you use vim inside visual studio. Pretty dandy.[/QUOTE] QtCreator has a similar "Fake Vim" mode, and allows you to quickly open any file in an external editor with a keybind, also handy.
How do I blit to a framebuffer into a cache-friendly manner, so I don't waste cycles on uselessness? I need to blit a vertical slice in the fastest possible way. (multi-platform too)
Has anyone here heard of FIPS140? I may be asking this in the wrong forum, but its worth a shit
When I am trying to use a Sampler2DShadow in GLSL, it only returns a value of 1 or 0. [cpp]float visibility = textureProj(shadowMap, vec4(ShadowCoord.xy, ShadowCoord.z-bias, ShadowCoord.w));[/cpp] And the comparison functions are: [cpp]glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);[/cpp] Fixed, you need to have the min/max filter be linear rather than nearest.
[QUOTE=areolop;41792885]Has anyone here heard of FIPS140? I may be asking this in the wrong forum, but its worth a shit[/QUOTE] Yes. FIPS has multiple security levels; levels 1 and 2 apply to software, higher levels also deal with hardware. If you're looking at software implementations of common hashing or encryption algorithms, FIPS-compliance is usually a good thing. If they just claim to be FIPS-compliant, it doesn't mean they're validated - you'll have to check the validation lists provided by NIST for that, but only organizations that really care about it bother to validate their cryptographic modules.
Have anyone here used any of the FFT libraries for C++? I want a recommendation of a really simple one.
[QUOTE=thf;41796529]Have anyone here used any of the FFT libraries for C++? I want a recommendation of a really simple one.[/QUOTE] fffft was the only one i could find that didnt cost lots of monies
[QUOTE=Richy19;41796573]fffft was the only one i could find that didnt cost lots of monies[/QUOTE] Can't find it. Googling that just brings up a lot of random YouTube videos.
I've used FFTW and NFFT for non-equispaced FFT.
[QUOTE=ThePuska;41796599]I've used FFTW and NFFT for non-equispaced FFT.[/QUOTE] FFTW seems simple and good, thanks!
my bad, its actually fftreal under the wtfyw license [url]http://ldesoras.free.fr/prod.html#src_fftreal[/url]
I'm a bit confused on how to implement cube map shadow mapping. The general idea that I have in my head is: [code]Setup: Generate framebuffer Generate cube map and bind it to the framebuffer Update: Draw onto each cube side in cube map using glFramebufferTexture2D Draw the scene, and compare the z with the stored value[/code] However, I have run into some issues, namely: The framebuffer complains that it is not complete, as there is no renderbuffer attachment. Is this necessary if I am rendering to a texture? When I draw the scene for each cube map side, what matrix am I supposed to use? Previously, with a spotlight, I would use a depth MVP matrix, which meant the projection matrix (an ortho projection), the camera's lookAt() matrix, and the model's matrix. However now I am not sure what matrix to use in place of the camera's lookAt() matrix. Although I am unsure about some other things, like how the sampling should be done, I think this will be easier to figure out once I get the previous questions answered. I have read some more about this issue, and it seems to me that the view matrix for each side of the cubemap should be changed to face in its direction (I am yet to test this). Furthermore, it seems that storing depth data is not enough unless you want to manually pick which cubemap side to use. The better idea is to store the distance from the light source to the fragment. Having done so I seem to have got something to work a bit better. Now I illuminate a sphere around myself, however no shadows are actually cast.
Using SDL with OpenGL. It's making the GPU whine, though. Trying to enable VSync. This doesn't seem to work though: [cpp] ... SDL_SetVideoMode(1024, 768, 32, SDL_OPENGL | SDL_RESIZABLE | SDL_DOUBLEBUF); SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); ... [/cpp] It's windowed by the way, running on Windows. [editline]11th August 2013[/editline] Solved it! SDL_GL_SetAttribute should be called before SDL_SetVideoMode.
Since Ludum Dare 27 is in two weeks (note note), I decided to not use XNA this time. People have told me that SFML is great, so I downloaded SFML.NET, created a new project on VS2010 and wrote some code. [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; using SFML.Audio; using SFML.Graphics; using SFML.Window; namespace SFMLtest { class Program { static void Main(string[] args) { RenderWindow window = new RenderWindow(new VideoMode(640, 400), "SFML test"); window.Closed += new EventHandler(OnClose); // stuff loads here Sprite texture = new Sprite(new Texture("resource/sfml-logo-small.png")); while (window.IsOpen()) { window.DispatchEvents(); window.Clear(); // draw loop window.Draw(texture); window.Display(); } } static void OnClose(object sender, EventArgs e) { RenderWindow window = (RenderWindow)sender; window.Close(); } } } [/code] Let's try it ou- [code]Could not load file or assembly 'sfmlnet-graphics-2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.[/code] ?
[QUOTE=Funley;41811150]Since Ludum Dare 27 is in two weeks (note note), I decided to not use XNA this time. People have told me that SFML is great, so I downloaded SFML.NET, created a new project on VS2010 and wrote some code. [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; using SFML.Audio; using SFML.Graphics; using SFML.Window; namespace SFMLtest { class Program { static void Main(string[] args) { RenderWindow window = new RenderWindow(new VideoMode(640, 400), "SFML test"); window.Closed += new EventHandler(OnClose); // stuff loads here Sprite texture = new Sprite(new Texture("resource/sfml-logo-small.png")); while (window.IsOpen()) { window.DispatchEvents(); window.Clear(); // draw loop window.Draw(texture); window.Display(); } } static void OnClose(object sender, EventArgs e) { RenderWindow window = (RenderWindow)sender; window.Close(); } } } [/code] Let's try it ou- [code]Could not load file or assembly 'sfmlnet-graphics-2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.[/code] ?[/QUOTE] You need the CSFML dll's and the normal SFML dlls for it to work
[QUOTE=Richy19;41811743]You need the CSFML dll's and the normal SFML dlls for it to work[/QUOTE] [t]https://dl.dropboxusercontent.com/u/43546107/photos/error.PNG[/t] Also, there are warnings; [code] Assembly generation -- Referenced assembly 'sfmlnet-window-2.dll' targets a different processor Assembly generation -- Referenced assembly 'sfmlnet-graphics-2.dll' targets a different processor Assembly generation -- Referenced assembly 'sfmlnet-audio-2.dll' targets a different processor [/code] Does this mean that the dlls are not for 64-bit systems? I did download the 64-bit version.
[QUOTE=Funley;41812792][t]https://dl.dropboxusercontent.com/u/43546107/photos/error.PNG[/t] Also, there are warnings; [code] Assembly generation -- Referenced assembly 'sfmlnet-window-2.dll' targets a different processor Assembly generation -- Referenced assembly 'sfmlnet-graphics-2.dll' targets a different processor Assembly generation -- Referenced assembly 'sfmlnet-audio-2.dll' targets a different processor [/code] Does this mean that the dlls are not for 64-bit systems? I did download the 64-bit version.[/QUOTE] You don't add the csfml DLLs as references, just put them in with your executable.
How do I write data that isn't depth data into a depth texture? I want to write the distance rather than the gl_FragCoord.z. Ok so I think I'm just supposed to use a color buffer instead then, however using color attachment 0 and writing a value of over 1 clamps it to 1. What gives? Nope, basically what I am supposed to do is let the depth buffer just store its info. Then, through the use of this handy function found on SO, you can convert a distance to a depth value: [cpp]float VectorToDepthValue(vec3 Vec){ vec3 AbsVec = abs(Vec); float LocalZcomp = max(AbsVec.x, max(AbsVec.y, AbsVec.z)); const float f = 2048.0; const float n = 1.0; float NormZComp = (f+n) / (f-n) - (2*f*n)/(f-n)/LocalZcomp; return (NormZComp + 1.0) * 0.5; }[/cpp]
So i'm trying to do this, I got a code (it's not from any language, I want to interpet it); [code] printchar 41 printchar 54 [/code] I split it into an array uisng .split to separate spaces, but then there's the problem, I can parse first one, but I want to parse as much as posslble, how? this is how I parse: [code] //words is the array that contains the string separated per lines if(words[0] == "char") { character = Convert.ToInt16(words[1]); }[/code]
Hey guys, I suppose I'll ask here since it doesn't seem like there is a maths thread currently active. This is more of a maths question, but being applied in a programming sense. So let us assume I have two "Points", A and B. These points are defined in 3D space with the triplets <X,Y,Z>, where Z is the vertical axis (up/down), X is the horizontal axis (left/right), and Y is the depth axis (forward/back). These points are directional - imagine them being arrows that only take up one cubic unit of space. Their angles are defined by the triplet <P,Yy,R>, where P is the 2D angle (in degrees) from the XY plane; Yy is the 2D angle (in degrees) from the XZ plane; and R is the 2D angle from the YZ plane. For the sake of clarification, to minimize misunderstandings: A oriented point can be described as a sextuplet: <X,Y,Z,P,Yy,R>. A point that is centered at the origin of the world and is facing with its tip pointing down the depth axis (Y; pointing straight toward the observer) would be described as <0,0,0,0,0,0>. A point centered at the origin of the world with its tip pointing straight up the vertical axis, the "bottom" of the arrow pointing toward the observer, would be described as <0,0,0,90,0,0>. A point centered at the origin with its point rotated 45* above both axes (pointing toward the far-right corner of the box, if you were to put it in the middle of the box) would be described as <0,0,0,45,45,0>. [b]NOW[/b], with all of that terminology defined, here is my situation. I have two oriented points, A and B, in 3D space. I want to orient A such that the tip of its arrow is pointing toward B, and I do not care what the orientation of B is. I have the <X,Y,Z,P,Yy,R> for both A and B. If I can get the absolute <P,Yy,R> to rotate A to make it point to B and ignore A's current rotation, that is fine; if I can get the relative <P,Yy,R> to rotate A to make it point to B (a <P,Yy,R> that I can add to A's to result in the desired orientation), then that would be even better. How the hell would I do this? I've looked around, and I can determine that what I want are Euler angles. I found an equation that computes a dot-product for an axis of rotation for quaternions, but I can't use quaternions for this; they [b]have[/b] to Euler angles. I have looked up how to convert between them, but I don't understand the equations or quaternions. Namely, quaternions are described as <x,y,z,w> where w is the angle of the axis of rotation (I guess?); I don't know what the <x,y,z> describe in quaternions. If anyone can help me figure this out, it would be greatly appreciated. Thank you! Here is an animated GIF representing my situation: [t]https://dl.dropboxusercontent.com/u/8416055/DeleteMe/Rotation.gif[/t]
[QUOTE=eirexe;41815168]So i'm trying to do this, I got a code (it's not from any language, I want to interpet it); [code] printchar 41 printchar 54 [/code] I split it into an array uisng .split to separate spaces, but then there's the problem, I can parse first one, but I want to parse as much as posslble, how? this is how I parse: -code snip-[/QUOTE] What do you mean? You want to do something like this? [code] string[] content; //assuming this is the current line split by spaces for (int i = 0; i < content.Length; i++) { if (content[i] == "specialCommand") { Command(content[i + 1]); //content[i + 1] is the argument for your command i += 1; //we skip the number of arguments the command has } else //when it's not one of your comnands, we skip continue; //or you can just throw an exception } [/code] [editline]13th August 2013[/editline] [QUOTE=Gmod4ever;41823890]-snip- I have two oriented points, A and B, in 3D space. I want to orient A such that the tip of its arrow is pointing toward B, and I do not care what the orientation of B is. I have the <X,Y,Z,P,Yy,R> for both A and B. If I can get the absolute <P,Yy,R> to rotate A to make it point to B and ignore A's current rotation, that is fine; if I can get the relative <P,Yy,R> to rotate A to make it point to B (a <P,Yy,R> that I can add to A's to result in the desired orientation), then that would be even better. How the hell would I do this? -snip-[/QUOTE] Get the distance between A and B on X, Y and Z axis. These will be dx, dy, dz. For pitch, use atan2(dx, dz) and for yaw use atan2(dx, dy) atan2 returns in radian edit: I reread your terminology, so I think I was wrong. if pitch is really on XY plane and Yaw is on XZ plane, then: pitch is atan2(dx, dy) and yaw is atan2(dx, dz) otherwise use the above solution
[QUOTE=ichiman94;41824164] Get the distance between A and B on X, Y and Z axis. These will be dx, dy, dz. For pitch, use atan2(dx, dz) and for yaw use atan2(dx, dy) atan2 returns in radian edit: I reread your terminology, so I think I was wrong. if pitch is really on XY plane and Yaw is on XZ plane, then: pitch is atan2(dx, dy) and yaw is atan2(dx, dz) otherwise use the above solution[/QUOTE] Thank you for the quick response. However, I fear that I left out some pretty important information, and I apologize. The problem I posted is actually only part of the problem, and while your solution solves it smashingly, it is not the bigger problem I am having. Long story short, I am trying to implement Cyclical Coordinate Descent Inverse Kinematics. You can see my post which explains it in more detail here: [url]http://facepunch.com/showthread.php?t=1196077&p=41805359&viewfull=1#post41805359[/url] The problem I posted and the solution you responded with solves the case of rotating the end effector, and I thank you for that. However, the bigger problem is rotating all of the [b]other[/b] bones. Basically, I have two vectors: vector Q = the vector between the current bone and the end-effector, and vector P = the vector between the current bone and the target. What I need to do is rotate the current bone by the angle between those two vectors. If I understand it correctly, this should make it so that the vector between the current bone and the end-effector is in the same direction as the vector between the current bone and the target, which would make sense, because the whole idea of the inverse kinematics is to rotate the chain so that it is touching the target. I am not certain on this interpretation, though, so don't like this detail hang you up, if you're trying to solve this for me. I have been able to compute the dot-product, which I presume is the angle of rotation (w) in a quaternion. I just don't know how to do the actual rotation. Sorry about the confusion. It's just, I am really confused about this myself. All of the rules and definitions I gave still apply though. Everything has to be in Eulers at the end of the day - I can't feed the bone a quaternion for rotation or position. Here is a diagram of how the algorithm is supposed to behave, in a simple chain in 2D. I am trying to extend this to 3D. I hope this helps clarify what I am trying to achieve. [url=https://dl.dropboxusercontent.com/u/8416055/DeleteMe/IK.png]linked because long[/url]
I am using SFML to draw something along the lines of this: [IMG]http://upload.wikimedia.org/wikipedia/commons/3/37/Bubble_sort_animation.gif[/IMG] I am sorting a vector while drawing the changes each frame. However, in the numbers there is a change but when it draws it they are exactly the same as before they are sorted. [IMG]https://dl.dropboxusercontent.com/u/16981959/unsortedsorted.jpg[/IMG] The numbers are the y scale of each bar. Here is the code: [url]http://codebin.org/view/45d13271[/url] Please try to ignore the poor code as it was supposed to just be a simple test to see how it would look before I implemented it fully.
[QUOTE=Cyrill Jones;41826197]I am using SFML to draw something along the lines of this: [IMG]http://upload.wikimedia.org/wikipedia/commons/3/37/Bubble_sort_animation.gif[/IMG] I am sorting a vector while drawing the changes each frame. However, in the numbers there is a change but when it draws it they are exactly the same as before they are sorted. [IMG]https://dl.dropboxusercontent.com/u/16981959/unsortedsorted.jpg[/IMG] The numbers are the y scale of each bar. Here is the code: [url]http://codebin.org/view/45d13271[/url] Please try to ignore the poor code as it was supposed to just be a simple test to see how it would look before I implemented it fully.[/QUOTE] [url]https://github.com/Mega1mpact/VisualSort/[/url] I hope that this will help you to understand how I did the visual sorting. I'll have a look at your code once my visual studio finishes installing
[QUOTE=Gmod4ever;41826141]Basically, I have two vectors: vector Q = the vector between the current bone and the end-effector, and vector P = the vector between the current bone and the target. What I need to do is rotate the current bone by the angle between those two vectors. If I understand it correctly, this should make it so that the vector between the current bone and the end-effector is in the same direction as the vector between the current bone and the target, which would make sense, because the whole idea of the inverse kinematics is to rotate the chain so that it is touching the target. I am not certain on this interpretation, though, so don't like this detail hang you up, if you're trying to solve this for me. I have been able to compute the dot-product, which I presume is the angle of rotation (w) in a quaternion. I just don't know how to do the actual rotation.[/QUOTE] Lets use your declaration of Q and P. What you might want to do is to subtract the angles of P from Q, and you use these angles to add to your current bone. [editline]14th August 2013[/editline] [QUOTE=Cyrill Jones;41826197]I am sorting a vector while drawing the changes each frame. However, in the numbers there is a change but when it draws it they are exactly the same as before they are sorted. Here is the code: [url]http://codebin.org/view/45d13271[/url] Please try to ignore the poor code as it was supposed to just be a simple test to see how it would look before I implemented it fully.[/QUOTE] You really sorted them, but you forgot about their position, so they stay at where they were created. Just set their position too and it will work. You can even swap their scales too, so you don't have to reposition them.
Sorry, you need to Log In to post a reply to this thread.