• What do you need help with? V4 (January 2012)
    966 replies, posted
  • Does anyone know of a good tutorial that both explains and shows how to implement Marching Cubes? I can only find either already implemented stuff with no comments or theoretical explanations and can't make sense of either of them :v: Books would be fine too, I plan on really getting into it.
  • [QUOTE=evil-tedoz;34504850]Which book would you recommend if I want to learn about design patterns ? Preferably with examples in C++.[/QUOTE] [url=http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612]Design Patterns: Elements of Reusable Object-Oriented Software[/url] and [url=http://www.amazon.com/First-Design-Patterns-Elisabeth-Freeman/dp/0596007124]Head First Design Patterns[/url] (Java examples though) Both are pretty good.
  • is anyone here good with SFML? I am trying to implement a scrolling, but instead it just shoots my character across the screen, in the opposite direction of where I want it to scroll. [code]sf::FloatRect screen (0,0,800,600); sf::View view1(screen); if(Player1.x<10) { view1.Move(-1,0); window.SetView(view1); }[/code]
  • First, to oppose the direction, change the -1 to a 1 Second, the game is probably looping too fast, causing the player to shoot across the screen fast And thirdly, view1.Move() will not change the position of the player. So I would do something such as this: [code]if(Player1.x < (view1.x + 10)) { ... [/code]
  • I'm setting a keyboard hook to simulate media keys. However, it's fired twice when I press Ctrl+Alt+Home once. Here's my KeyboardProc: [cpp] LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode < 0) return CallNextHookEx(0, nCode, wParam, lParam); if ((lParam & (1 << 31)) && (lParam & (1 << 30))) { //up now and down before bool bCtrl = GetKeyState(VK_CONTROL) < 0; bool bAlt = GetKeyState(VK_MENU) < 0; if (bCtrl && bAlt) { switch (wParam) { case VK_HOME: //SendKeyboardInput(VK_MEDIA_PLAY_PAUSE); MessageBox(NULL, "CTRL+ALT+HOME", "Hook", MB_ICONINFORMATION); return true; case VK_END: //SendKeyboardInput(VK_MEDIA_STOP); MessageBox(NULL, "CTRL+ALT+END", "Hook", MB_ICONINFORMATION); return true; case VK_PRIOR: //SendKeyboardInput(VK_MEDIA_PREV_TRACK); MessageBox(NULL, "CTRL+ALT+PGUP", "Hook", MB_ICONINFORMATION); return true; case VK_NEXT: //SendKeyboardInput(VK_MEDIA_NEXT_TRACK); MessageBox(NULL, "CTRL+ALT+PGDN", "Hook", MB_ICONINFORMATION); return true; } } } return CallNextHookEx(0, nCode, wParam, lParam); } [/cpp] Is there any way to make sure it's only fired once? [editline].[/editline] Wow, that was quick. I tried it with sending the media keys, instead of doing a message box, and it just works right. If someone can explain why it happened, that would be great, but either way, it works now.
  • Working on some IT coursework. It has to be written in VB6 :v: Here's what I have so far: [img]http://i.imgur.com/2JE8v.png[/img] It's a Point Of Sale system for a fast food outlet. The UI's horrible so far, I'll move some stuff around and tidy it up in a bit. The form's all laid out at runtime, and the menu is laid out dynamically using images from a directory: [img]http://i.imgur.com/UwG8t.png[/img] Adding a new product involves pasting a picture of it into that folder, and making sure that the filename ends in "£price" - the application handles the rest. It prints out receipts (using a regular printer) and you can also view a log that's stored in a text file: [img]http://i.imgur.com/JWmcL.png[/img] That bit's actually necessary to get top marks. I'm not quite sure why. All that's left to do now is add a login form, write a 50-page writeup, print it out and mail it to the bloody exam board. Yay :v: [editline]3rd February 2012[/editline] Added a login form. Password details are just stored as salted MD5 hashes, but everyone else in my class is storing login details in plain text files (if not just a bunch of 'elseif username = "bob" and password = "password"'), so I think I might get away with it :S
  • I just started using the "Son of Obsidian" theme for visual express (c#), and my god, it is beautiful. I just stared at my code for the last 10 minutes looking at how cool the color scheme is. Does anyone else like their theme, if they used one?
  • I just started a class programming in C and C++ and I was trying to write like a super basic program and I am having problems getting the equation part of the code to execute... [code]# include <stdio.h> int main(void){ float celsius, fahrenheit; printf("Please enter a temperature in degress Fahrenheit: "); scanf("%f", &fahrenheit); celsius = (5 / 9) * ( (float) fahrenheit - 32); printf("The temperature of %f in degrees Celsius is %f.\n", fahrenheit, celsius); return 0; } [/code] It just gives me zeros as the answer. I'm sure it is something really simple I just have basically no experience :P Thanks!
  • [QUOTE=ZachPL;34534433]I just started a class programming in C and C++ and I was trying to write like a super basic program and I am having problems getting the equation part of the code to execute... [code]# include <stdio.h> int main(void){ float celsius, fahrenheit; printf("Please enter a temperature in degress Fahrenheit: "); scanf("%f", &fahrenheit); celsius = [b](5f / 9f)[/b] * ( (float) fahrenheit - 32f); printf("The temperature of %f in degrees Celsius is %f.\n", fahrenheit, celsius); return 0; } [/code] It just gives me zeros as the answer. I'm sure it is something really simple I just have basically no experience :P Thanks![/QUOTE]You have to add an f to the end of the 5 and 9, otherwise it'll give 0 because it does integer division.
  • -snip- Anyways, for the c# winform guys here, is there a stigma against explicitly calling click events inside your program?
  • [QUOTE=Octave;34534654]You have to add an f to the end of the 5 and 9, otherwise it'll give 0 because it does integer division.[/QUOTE] I removed the float and just added .0 to all the integers to make them floats and then it worked. Thanks for the help.
  • So i have two Vector3 values in XNA. They are a 3D camera's position and target. How can i rotate the target vector around the position and keep it at a constant distance from the position all the time? [editline]lol[/editline] Also, how do i do collision with vertices and the camera's position?
  • XNA or Pygame? I already know some xna so I guess this is a stupid question but what do you guys prefer? (didn't want to make a thread) Also is making a simple text based game ( like the good 'ol roguelikes or DwarfFortress or something ) possible with either or should I do it in java or something?
  • [QUOTE=ZachPL;34534851]I removed the float and just added .0 to all the integers to make them floats and then it worked. Thanks for the help.[/QUOTE] That actually makes them doubles. Just saying.
  • [QUOTE=Funley;34539858]So i have two Vector3 values in XNA. They are a 3D camera's position and target. How can i rotate the target vector around the position and keep it at a constant distance from the position all the time? [editline]lol[/editline] Also, how do i do collision with vertices and the camera's position?[/QUOTE] Here's a camera class I wrote for a free moving camera in XNA, and the Particle class it extends from. [url]http://pastebin.com/zu0XMMNP[/url] [url]http://pastebin.com/TGeUcX5X[/url] It uses a combination of a Vector3 for the change in rotation values, and updating a matrix based on them. You can then use that matrix's forward vector and multiply it (or not) to get your target. It's all in the UpdateViewMatrix function.
  • [QUOTE=DestWa;34539883]XNA or Pygame? I already know some xna so I guess this is a stupid question but what do you guys prefer? (didn't want to make a thread) Also is making a simple text based game ( like the good 'ol roguelikes or DwarfFortress or something ) possible with either or should I do it in java or something?[/QUOTE] I second this question. Of course most will say to program roguelikes in some form of Curses with c++.
  • You can make a rougelike using literally anything you have, as long as you can output things. I suggest XNA since you know it already, but I am unfamiliar with pygame so I might be biased.
  • So I've got this dylib that I want to dynamically link against another dylib. Anyone know how I can do that? [editline]5th February 2012[/editline] Also, the other dylib doesn't have 'lib' in its name...
  • Snip: OpenGL and me do not agree. I am forcing OpenGL to agree with me instead of retreating to DirectX.
  • How can i do collisions with a Vector3 (XNA) and many, many vertices? [editline].[/editline] Help please?
  • So I'm learning java because I heard that it's the standard language in universities (I plan to move to C++ when i'm done) But i'd like to see some example programs made in java so I could know what i'm working towards. If anyone has anything impressive that they made in java I would love it if you showed me.
  • I'm trying to use Tesseract in VB.NET, and whenever I try to call Init, it either closes without a message, or it says this: [img]http://speedcap.net/img/aadeb96bb708a2e5bceb75a7a95c8002/ddd10cfb.png[/img] [code] Try Dim T As New Tesseract Using O As New OpenFileDialog With O If Not .ShowDialog = DialogResult.Cancel Then Dim B As Bitmap = New Bitmap(.FileName) T.Init(Application.ExecutablePath, "Eng", False) Dim L As List(Of Word) = T.DoOCR(B, Rectangle.Empty) For Each w As Word In L MessageBox.Show(w.Text) Next End If End With End Using Catch Ex As Exception MessageBox.Show(Ex.Message) End Try [/code] I seriously don't know what's wrong with it. [editline]5th February 2012[/editline] Okay, this shit is starting to piss me off. Is there seriously not one free fucking OCR library that isn't absolute garbage? Getting these retarded fucking errors with Puma.NET [img]http://speedcap.net/img/aadeb96bb708a2e5bceb75a7a95c8002/1a761b07.png[/img] I'm about to punch a hole in my monitor
  • Hey guys, I've got a problem that I'm stuck on for Digital Systems Design class. We're supposed to take f(w, x, y, z) = (w*x')+(w'*y'*z')+(w'*x'*z)+(w'*x'*y*z') and implement it with five two-input gates or less. I've tried minterms, maxterms and genearal alegbraic manipulation but I simply cannot get this to simplify down enough to only use 5 gates. I don't need the full solution, but if someone could give me a starting point I'd sure appreciate it. [editline]5th February 2012[/editline] Nevermind, I got it.
  • [QUOTE=TheCloak;34560515] Okay, this shit is starting to piss me off. Is there seriously not one free fucking OCR library that isn't absolute garbage?[/QUOTE] From my experience, no, there isn't.
  • Potentially stupid question time. How do you get rid of the gradient and shadow Xcode applies to tab bar images in an iOS app? I've changed the images for the bar items by selecting an imported one in the storyboard, and that just adds the effects (as expected). I'm assuming I'd have to go into AppDelegate.m and set up something like this: [code] // Customize the Home bar item UIImage *barItemHome = [[UIImage imageNamed:@"home.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UIBarItem appearance] setBackgroundImage:barItemHome forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [/code] This doesn't work, though, and even if it did I have no way of selecting just the "Home" bar item to apply it to and not all of the icons. Google hasn't helped me as all of the tutorials seem to work only for older iOS versions since iOS 5 decided to fuck with the way everything is called.