• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=Richy19;31179361]Hes using openGL tho[/QUOTE] The same techniques are available in OpenGL though (as is the same for just about any graphics technique), that's why I said DX11 hardware rather than DX11 was required. Here is an [URL="http://blog.icare3d.org/2010/06/fast-and-accurate-single-pass-buffer.html"]OpenGL implementation[/URL] of the same technique if you're interested but the other link gives much more explanation. I'm not specifically recommending this method anyway, I was just confirming that it was indeed possible.
[QUOTE=MallocNull;31177540]I've been working at this for a bit and can't seem to figure out the issue. I'm just practicing programming in F# by calculating pi using the formula [img]http://upload.wikimedia.org/math/2/2/b/22b7522ff9aef6794f2342a8d1b65648.png[/img] and pi = 4/Z. The code I have currently is as follows. [code]#light let invert x = 4I/x let factorial x = Seq.fold(*) 1I [1I .. x] let pow x y = Seq.fold(fun acc i -> x * acc) 1I [1I .. y] let permutation n k = (factorial n) / factorial (n-k) let epi i = (((6I*i)+1I)*((permutation 3I i)/2I))/((pow 4I i)*(pow (factorial i) 3I)) let pi = Seq.fold(fun acc i -> acc + epi i) 0I { 0I .. 100I } |> invert printfn "%A"pi open System Console.ReadKey(true)[/code] It outputs 4 no matter what you change the upper limit for the fold to on line seven. I assume it has something to do with how I'm using the "I" typecast, but I'm really not too sure.[/QUOTE] Yes, as all your number literals are System.Numerics.BigIntegers, the inferred return type of your functions will be BigInteger, which will (for obvious reasons) not result in a decimal approximation of Pi.
[QUOTE=Chris220;31177682]Surely there's some way I could use a depth buffer to do transparency though? Like... let's say the water is being drawn before the terrain behind it, each fragment is placed in a higher location in the depth buffer, then later on the terrain fragment is put in a deeper location. Once everything's done, I can blend all the alpha values together (because they're now in the correct order in the depth buffer) and draw that fragment.[/QUOTE] A depth buffer doesn't store a stack of multiple color values, though; it just stores a single distance associated with the single color of its pixel. However, for the common case of a single flat water surface, you don't actually need to sort by depth because it's never possible to see a water face through another water face. So if you want a 90% solution that works fine for that common case, just make sure you draw all the water after all the non-water. [editline]17th July 2011[/editline] [QUOTE=Icedshot;31176775]So, im pretty stuck on how to convert coordinates that are relative to the cameras current position into clip space. Would someone mind explaining how you might (practically) go about transforming the vertex xyz? I understand what clip space *is*, just not how to get there[/QUOTE] Do you know about [url=http://en.wikipedia.org/wiki/Transformation_matrix]transformation matrices[/url]? Multiplying a vector by a matrix yields another vector, and with points expressed as vectors, you can create matrices to express transformations like translation, rotation, and scaling. It's usually done in two steps: a "modelview" transformation that represents the position of the object in the world, and a "projection" transformation that represents the position of the camera. Old-style OpenGL had these as built-in features of the API, and you could manipulate the two matrices with functions like glTranslate3f() and gluPerspective(), so you might start by reading about those.
[QUOTE=MallocNull;31177540]I've been working at this for a bit and can't seem to figure out the issue. I'm just practicing programming in F# by calculating pi using the formula and pi = 4/Z. The code I have currently is as follows. [code]#light let invert x = 4I/x let factorial x = Seq.fold(*) 1I [1I .. x] let pow x y = Seq.fold(fun acc i -> x * acc) 1I [1I .. y] let permutation n k = (factorial n) / factorial (n-k) let epi i = (((6I*i)+1I)*((permutation 3I i)/2I))/((pow 4I i)*(pow (factorial i) 3I)) let pi = Seq.fold(fun acc i -> acc + epi i) 0I { 0I .. 100I } |> invert printfn "%A"pi open System Console.ReadKey(true)[/code] It outputs 4 no matter what you change the upper limit for the fold to on line seven. I assume it has something to do with how I'm using the "I" typecast, but I'm really not too sure.[/QUOTE] Pardon me for being a dinosaur good sir, but what is the correct name for that field of mathematics/physics? A number of sources appear to claim that learning vector algebra is generally a very good idea when it comes to various engine related projects/graphics.
[QUOTE=Map in a box;31178662]Doesn't sacrifice the compiler optimizations at all. Unless the compiler is an idiot, it should convert the for loops to while loops. [editline]17th July 2011[/editline] thus, actually decreasing the compilers load by a bit[/QUOTE] Yes, but there are for loop specific optimizations such as loop unrolling that just doesn't apply in to context of a while loop.
And another question, is there an efficient way of studying or going through the functionality of an unfamiliar code without necessarily going through the documentation? possibly labeled as "library exploration"?
Documentation is designed to help you understand what's going on, and so are comments. I would personally look through the documentation, then while going through methods, focus a lot on the comments which should explain the finer points of what's going on in the code. As a rule of thumb, if you feel like you need to explain the code to anyone, you should comment it. If the library is well commented (things like "if (x > 4) //if x is greater than 4" and "} //end method" are completely useless) then it should be fairly easy to understand what's going on at a higher level.
[QUOTE=robmaister12;31188882]Documentation is designed to help you understand what's going on, and so are comments. I would personally look through the documentation, then while going through methods, focus a lot on the comments which should explain the finer points of what's going on in the code. As a rule of thumb, if you feel like you need to explain the code to anyone, you should comment it. If the library is well commented (things like "if (x > 4) //if x is greater than 4" and "} //end method" are completely useless) then it should be fairly easy to understand what's going on at a higher level.[/QUOTE] I am partially talking about systematic methods of making the process of understanding code more efficient, such as C tags that vim has.
Well I split my world up into opaque and translucent blocks, and rendered them in that order. Works like a charm, thank you so much! Now I can get back to doing terrain generation, which is awesome :D
[QUOTE=Chris220;31188973]Well I split my world up into opaque and translucent blocks, and rendered them in that order. Works like a charm, thank you so much! Now I can get back to doing terrain generation, which is awesome :D[/QUOTE] Which libraries are you currently using for your project?
[QUOTE=genkaz92;31189006]Which libraries are you currently using for your project?[/QUOTE] A simple voxel-based (read: minecraft style) game. I would post a screenshot, but my terrain generation is basically non-existent at the moment, so you'll have to wait for a while :P Keep checking WAYWO, I'll post about it there eventually. Edit: Woah what, you changed your post completely?
In Lua, is there a way to call a function, not directly by its function name though? Like: call_function("Function1()") or something like that? I'm trying to do dynamic buttons
[QUOTE=TheCloak;31193016]In Lua, is there a way to call a function, not directly by its function name though? Like: call_function("Function1()") or something like that? I'm trying to do dynamic buttons[/QUOTE] _G["Function1"]()
-nevermind-
When I use sfmls RenderWindow.Clear(); it gives me a buffer overrun. Not much code to look at, but when i comment out clear, it works.
We literally can't help you if you're not going to show us your code.
[QUOTE=Map in a box;31204587]When I use sfmls RenderWindow.Clear(); it gives me a buffer overrun. Not much code to look at, but when i comment out clear, it works.[/QUOTE] Oh that's easy just remove your 5 instances of sf::Sprite that you're drawing incorrectly to your buffer and... Code please.
currently working on a simple test game that I am trying to implement into a webpage. The game works fine in eclipse and has no problem launching. However after going through the perilous process of signing all the JARs and getting the requires libraries to load I have hit a dead end. Here is the HTML File I am using to load the JAR files. [code] <applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar" codebase="." width="800" height="600"> <param name="al_title" value="botGame"> <param name="al_main" value="BRANDON.GameApplet"> <param name="al_jars" value="game.jar, lwjgl.jar"> <param name="al_logo" value=""> <param name="al_windows" value> <param name="al_windows" value="native-win32.jar"> <param name="al_linux" value="natives-linux.jar"> <param name="al_mac" value="natives-mac.jar"> <param name="al_progressbar" value=""> </applet> [/code] I signed all of these JARs so that shouldn't be the problem, but it gives me this error when loading. This occurred while 'Downloading packages' Unable to get input stream for native-win32.jar java.lang.Exception: Unable to get input stream for native-win32.jar at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1256) at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1146) at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:753) at java.lang.Thread.run(Unknown Source) Any help is appreciated.
Maybe I'm an idiot, but I'm just starting to learn Python and installing Python for Windows just doesn't seem to work for me. [url=http://learnpythonthehardway.org/book/ex0.html]This is the page I used.[/url] I'm using "Learn Python the Hard Way", and when I enter command prompt and type, "python", nothing happens. Even if I have Python installed.
[QUOTE=AgentBoomstick;31208836]Oh that's easy just remove your 5 instances of sf::Sprite that you're drawing incorrectly to your buffer and... Code please.[/QUOTE] Its funny because the Clear function is causing the error, I have no drawing code is why I wasn't going to post it. The clear function fills it with black according to the wiki and has nothing to do with any of these nonexistant sprites. [editline]19th July 2011[/editline] [QUOTE=Mrs Affinity;31216614]currently working on a simple test game that I am trying to implement into a webpage. The game works fine in eclipse and has no problem launching. However after going through the perilous process of signing all the JARs and getting the requires libraries to load I have hit a dead end. Here is the HTML File I am using to load the JAR files. [code] <applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar" codebase="." width="800" height="600"> <param name="al_title" value="botGame"> <param name="al_main" value="BRANDON.GameApplet"> <param name="al_jars" value="game.jar, lwjgl.jar"> <param name="al_logo" value=""> <param name="al_windows" value> <param name="al_windows" value="native-win32.jar"> <param name="al_linux" value="natives-linux.jar"> <param name="al_mac" value="natives-mac.jar"> <param name="al_progressbar" value=""> </applet> [/code] I signed all of these JARs so that shouldn't be the problem, but it gives me this error when loading. This occurred while 'Downloading packages' Unable to get input stream for native-win32.jar java.lang.Exception: Unable to get input stream for native-win32.jar at org.lwjgl.util.applet.AppletLoader.getJarInputStream(AppletLoader.java:1256) at org.lwjgl.util.applet.AppletLoader.downloadJars(AppletLoader.java:1146) at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:753) at java.lang.Thread.run(Unknown Source) Any help is appreciated.[/QUOTE] Do you have the native jars(all of them) in the same folder?
This isn't really a I need help with. Its just a quick question on using alpha channels with textures. Is it possible to tell the difference between two alpha channels?
[QUOTE=Zally13;31220443]Maybe I'm an idiot, but I'm just starting to learn Python and installing Python for Windows just doesn't seem to work for me. [url=http://learnpythonthehardway.org/book/ex0.html]This is the page I used.[/url] I'm using "Learn Python the Hard Way", and when I enter command prompt and type, "python", nothing happens. Even if I have Python installed.[/QUOTE] Make sure python is in your path, you will need to append it otherwises.
[QUOTE=darkrei9n;31221559]This isn't really a I need help with. Its just a quick question on using alpha channels with textures. Is it possible to tell the difference between two alpha channels?[/QUOTE] What do you mean?
[QUOTE=Map in a box;31222538]What do you mean?[/QUOTE] If you were say drawing sprites in a 2d game, and the sprites had a alpha channel, would you be able to say tell the difference between the two sprite's alpha channels?
[QUOTE=darkrei9n;31222749]If you were say drawing sprites in a 2d game, and the sprites had a alpha channel, would you be able to say tell the difference between the two sprite's alpha channels?[/QUOTE] Umm.. Alpha1-Alpha2? Or based off the color, in which I don't know.
[QUOTE=Map in a box;31220591] [editline]19th July 2011[/editline] Do you have the native jars(all of them) in the same folder?[/QUOTE] Yes, I have them in multiple locations just to try to get it to work :(
[QUOTE=Mrs Affinity;31223240]Yes, I have them in multiple locations just to try to get it to work :([/QUOTE] Put them in the folder of the jar. What IDE do you use? If eclipse, right click the project and choose export.
[QUOTE=Vbits;31221839]Make sure python is in your path, you will need to append it otherwises.[/QUOTE] How would I go about doing this?
I've started learning how to use OpenGL a while back, using the OpenGL SuperBible, Fifth Edition, and I've had people arguing about the fact that the book doesn't really teach how to use OpenGL but instead it teaches how to use two of the wrapper libraries related to it, glut and glTools. I've also been told that glut should never be used for full-blown projects, but there was no valid reason supplied with the argument. My question is why, and when should I not use the glTools/glut libraries, and what should I use instead? [editline]20th July 2011[/editline] I have also asked it here, [url]http://gamedev.stackexchange.com/questions/15038/why-should-i-not-use-gltools-glut-when-developing-complete-applications[/url] If you could answer there, it would be great.
The first part teaches to use the wrappers. Most likely this is done so that the examples wouldn't require teaching the use of native windowing APIs or writing new examples for each platform. The actual content obviously discusses the actual graphics API.
Sorry, you need to Log In to post a reply to this thread.