• What do you need help with? Version 5
5,752 replies, posted
[QUOTE=Richy19;35872991] If in OpenGL(2.1) I have a scene like the left, therefore the user views the right. Does the cube actually get rendered? [IMG]http://i.imgur.com/T6FK8.png[/IMG] The reason im asking is because in a voxel game(like minecraft for example) would it be necesairy to actually call or not call the draw for sides of cubes that are connected to other cubes?[/QUOTE] The GPU renders exactly what you tell it to, regardless of position. You'd have to devise your own culling method to reduce objects/faces/etc.
[QUOTE=Richy19;35872991]The reason im asking is because in a voxel game(like minecraft for example) would it be necesairy to actually call or not call the draw for sides of cubes that are connected to other cubes?[/QUOTE] So you're asking if you should draw faces that are hidden by other faces that are touching? No, obviously not, why would you?
[code] float d; int v; float a; float b; float c; for(int p = 0; p < 1; p++) { v = rand(); a = sin(v); b = cos(v); d = sqrt(pCols*pCols + pRows*pRows); c = (rand() / RAND_MAX) * d - d/2; for(int i = 0; i < pCols * pRows; i++) { if(a*vertexLoad[i].position.x + b*vertexLoad[i].position.z - c > 0) { vertexLoad[i].position.y += 1; } else { vertexLoad[i].position.y -= 1; } } } [/code] For some reason this causes an unhandled exception. The thing is, that if I increase p to 100, it will work perfectly all the way up the last pass then fail. So I don't know what the fuck is wrong with it. If I remove the offending line (d = sqrt(pCols*pCols + pRows*pRows);) the next line down causes the same error, and if I remove that cos(v) causes it.
[QUOTE=layla;35874570]So you're asking if you should draw faces that are hidden by other faces that are touching? No, obviously not, why would you?[/QUOTE] It was more, does the GPU automatically not render them due to there being something infront of them, so the user doesnt see them
[QUOTE=darkrei9n;35874815] For some reason this causes an unhandled exception. The thing is, that if I increase p to 100, it will work perfectly all the way up the last pass then fail. So I don't know what the fuck is wrong with it. If I remove the offending line (d = sqrt(pCols*pCols + pRows*pRows);) the next line down causes the same error, and if I remove that cos(v) causes it.[/QUOTE] Most likely a floating point exception.
[QUOTE=dajoh;35874950]Most likely a floating point exception.[/QUOTE] Access Violation.
[QUOTE=Richy19;35874928]It was more, does the GPU automatically not render them due to there being something infront of them, so the user doesnt see them[/QUOTE] No, you're still drawing faces that you don't need, just don't add them.
Is there a standard way in my .NET (C#) application of telling nVidia to use the main graphics card on laptops with both an integrated crap card and main powerful one? I've been doing it manually through the nVidia control panel but it would be nice if users wouldn't have to.
[QUOTE=darkrei9n;35874815][code] float d; int v; float a; float b; float c; for(int p = 0; p < 1; p++) { v = rand(); a = sin(v); b = cos(v); d = sqrt(pCols*pCols + pRows*pRows); c = (rand() / RAND_MAX) * d - d/2; for(int i = 0; i < pCols * pRows; i++) { if(a*vertexLoad[i].position.x + b*vertexLoad[i].position.z - c > 0) { vertexLoad[i].position.y += 1; } else { vertexLoad[i].position.y -= 1; } } } [/code] For some reason this causes an unhandled exception. The thing is, that if I increase p to 100, it will work perfectly all the way up the last pass then fail. So I don't know what the fuck is wrong with it. If I remove the offending line (d = sqrt(pCols*pCols + pRows*pRows);) the next line down causes the same error, and if I remove that cos(v) causes it.[/QUOTE] Debug it, see what the variables are set to when it throws an error.
[QUOTE=Protocol7;35877398]Debug it, see what the variables are set to when it throws an error.[/QUOTE] Already figured it out. Had some code after it that was causing it. I do not know why it threw the error there though. [code] for(int y = 0; y < pCols*pRows; y++) { vertexLoad[i].color = RED; } [/code] I was using i instead of y.
Can anyone help me with this? I'm making a simple minecraft launcher (Extra features, ect) and I go to try it on my friends computer, and the launcher comes up fine, but when he logs in to start minecraft, it doesn't work. Here is the snippet of code that starts it (works fine by me) [code] Dim process As New Process Dim info As New ProcessStartInfo Dim jarPath As String = "C:\Users\Dylan\AppData\Roaming\.minecraft\bin\minecraft.jar" info.FileName = "javaw" info.CreateNoWindow = True info.Arguments = "-cp " & Chr(34) & jarPath & ";%APPDATA%\.minecraft\bin/lwjgl.jar;%APPDATA%\.minecraft\bin/lwjgl_util.jar;%APPDATA%\.minecraft\bin/jinput.jar;" & Chr(34) & " " & Chr(34) & "-Djava.library.path=%APPDATA%\.minecraft\bin\natives" & Chr(34) & " -Xmx1024M -Xms512M net.minecraft.client.Minecraft " + player + " " + result(3) info.Arguments = info.Arguments.Replace("%APPDATA%", GetFolderPath(SpecialFolder.ApplicationData)) process.StartInfo = info process.Start() End[/code] Edit: I'm an idiot..... Dim jarPath As String = "C:\Users\[highlight]Dylan[/highlight]\AppData\Roaming\.minecraft\bin\minecraft.jar"
[url]http://pastebin.com/PVbfMQG8[/url] I'm trying make the player collide with the wall. The wall is a 31x31 cube but I can only make the player collide on the left face of the cube. I can't figure out how to add more sides without them overriding each other.
[QUOTE=Richy19;35872991]If in OpenGL(2.1) I have a scene like the left, therefore the user views the right. Does the cube actually get rendered?[/QUOTE] The vertex transformations and whatnot will always occur. The GPU will try to create fragments for every polygon, but the actual shading may or may not occur depending on the results of depth testing. This is why a lot of games do early-z passes or render front-to-back; it saves on shading overhead in forward renderers. Effectively, you may save on some fragment shading, but you still have to actually process the primitives. This is why we have visibility testing and occlusion queries in games.
Hello again folks, I require assistance once again in Visual basic 2010. I wouldn't ask this if I hadn't committed hours trying to solve it myself. But I need to get this nifty little simulation give somewhat logical numbers instead of astronomical coordinates and infinite decimals. Here's what I have trouble with in my nuclear strike simulator. There's a certain percentage of people from the total population of the city in certain range, and certain percent of those people in those ranges die. [code]Public Class Form1 Dim Oulu As Integer = 150000 ' Population of this city Dim Oulun_pinta_ala As Double = (1000 * 1410.17) ^ 2 'Area of whole city turned from square kilometers(1410.17) to meters Dim Oulun_asukastiheys As Integer = Oulu / Oulun_pinta_ala 'population density Dim Asukkaita_1140m_säteellä As Double = (1140 * 1140) * 3.14 / Oulun_pinta_ala * Oulu 'population in this range in meters Dim Asukkaita_3050m_säteellä As Double = (3050 * 3050) * 3.14 / Oulun_pinta_ala * Oulu 'population in this range in meters Dim Asukkaita_6200m_säteellä As Double = (6200 * 6200) * 3.14 / Oulun_pinta_ala * Oulu 'population in this range in meters[/code] [code] Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click If lblAsukasmaara.Text = "0" Then MsgBox("Valitse Kaupunki") End If If lblAsukasmaara.Text = Oulu Then kuollut1 = (100 - 88) / 100.0 * Asukkaita_1140m_säteellä 'death toll in these ranges kuollut2 = (100 - 33) / 100.0 * Asukkaita_3050m_säteellä kuollut3 = (100 - 11) / 100.0 * Asukkaita_6200m_säteellä yht = kuollut1 + kuollut2 + kuollut3 tulo1 = kuollut1 tulo2 = kuollut2 tulo3 = kuollut3 [/code] But I get results like this (note that "kuollut", "kuolleita" etc means "dead") [code]Kuolleita 1140 metrin säteellä: 0,0369376203597919 Kuolleita 3050 metrin säteellä: 1,47622462665414 Kuolleita 6200 metrin säteellä: 8,10310283100606 Kuolleita yhteensä: 9,61626507801999[/code] please forgive my stupidity :c
Hey everyone. I am in c++ programming in college and I could use a little help with a final project. This is my project; [code] Your programming assignment is to develop a program to find out the winner of the gymnastics competition. The winner is the gymnast with the highest score. Each gymnast will receive a score from seven (7) judges. The highest and lowest score will be thrown out. The remaining five scores will be averaged to determine the gymnast final score. The output will list each gymnast with their final score followed by the overall winner. Your input will come from a file with the name - OLYMPICS.TXT and have the data listed as follows OLGA KORBUT 8.8 7.8 3.4 8.9 10.0 6.5 9.9 MARY LOU RETTON 5.6 5.5 6.5 7.5 4.8 2.1 4.5 NADIA COMANECI 9.9 8.9 9.4 9.3 9.6 8.8 9.2 The number of Gymnasts in the file will vary. The results will be written to a file called - FINAL.TXT and have the format of Gymnast Score OLGA KORBUT 8.38 MARY LOU RETTON 5.38 NADIA COMANECI 9.28 The winner is NADIA COMANECI[/code] I am having trouble with this concept. All we have learned this year is basic stuff. This one has to do with loops and files. I am not sure how to go about this. I have tried doing some code for the past few days and cant figure this out correctly. Any tips or help will be greatly appreciated. What I know I should do is create a loop that inputs all the values and creates a high low type deal. I am not sure how to go about that correctly.
[code] case WM_MOUSEMOVE: mousePT.x = (int)LOWORD(lParam); mousePT.y = (int)HIWORD(lParam); dx = mousePT.x - gOldPos.x; dy = mousePT.y - gOldPos.y; Camera().onPitch(dx); Camera().onYaw(dy); gOldPos = mousePT; break; [/code] Ran into an issue with using the Win API for input, for some reason this does not work at all in moving the camera. (Camera Code) [code] void Camera::onPitch(float angle) { D3DXMATRIX R; D3DXMatrixRotationAxis(&R, &gRight, angle); D3DXVec3TransformNormal(&gUp, &gUp, &R); D3DXVec3TransformNormal(&gLook, &gLook, &R); } void Camera::onYaw(float angle) { D3DXMATRIX R; D3DXMatrixRotationY(&R, angle); D3DXVec3TransformNormal(&gRight, &gRight, &R); D3DXVec3TransformNormal(&gUp, &gUp, &R); D3DXVec3TransformNormal(&gLook, &gLook, &R); } void Camera::onRoll(float angle) { D3DXMATRIX R; D3DXMatrixRotationZ(&R, angle); D3DXVec3TransformNormal(&gUp, &gUp, &R); D3DXVec3TransformNormal(&gRight, &gRight, &R); } [/code]