[QUOTE=NorthernGate;26063779]The problem is I have no idea how to go about clearing and loading the alpha buffer and then loading it with the light intensity. The article doesn't actually go about telling me how to do that. Where as Overv's method is pretty clear.[/QUOTE]
Clearing is glClear(GL_COLOR_BUFFER_BIT); or something in deprecated OGL I think.
As for loading the light intensity:
[quote=http://www.gamedev.net/reference/articles/article2032.asp]Next we need to load the lights intensity into the alpha buffer. This does not need any blending, but depth testing is enabled this time to allow lights to be restricted to illuminating only the objects beneath them. Again colour writing is left disabled since we are not ready to render any visible geometry yet. The following function is used to create the geometry for a single light:
[cpp]public void renderLightAlpha(float intensity, GLDrawable canvas)
{
assert (intensity > 0f && intensity <= 1f);
GL gl = canvas.getGL();
int numSubdivisions = 32;
gl.glBegin(GL.GL_TRIANGLE_FAN);
{
gl.glColor4f(0f, 0f, 0f, intensity);
gl.glVertex3f(center.x, center.y, depth);
// Set edge colour for rest of shape
gl.glColor4f(0f, 0f, 0f, 0f);
for (float angle=0; angle<=Math.PI*2; angle+=((Math.PI*2)/numSubdivisions) )
{
gl.glVertex3f( radius*(float)Math.cos(angle) + center.x,
radius*(float)Math.sin(angle) + center.y, depth);
}
gl.glVertex3f(center.x+radius, center.y, depth);
}
gl.glEnd();
}[/cpp][/quote]
[QUOTE=ZeekyHBomb;26064144]Clearing is glClear(GL_COLOR_BUFFER_BIT); or something in deprecated OGL I think.
As for loading the light intensity:[/QUOTE]
What I'm confused on is that I was under the thought that doing glClear( GL_COLOR_BUFFER_BIT ); would clear the screen, and the void renderLightAlpha function just draws faded circles over an emptied screen.
What I thought I was supposed to be doing to was clearing a quad over the screen and then cutting the light geometry into that quad, the light geometry would be translucent showing the objects under the light. But I have no idea how to do that either.
[QUOTE=ZeekyHBomb;26064144]Clearing is glClear(GL_COLOR_BUFFER_BIT); or something in deprecated OGL I think.
As for loading the light intensity:[/QUOTE]
glClear is deprecated? What?
Eh, I don't think so; it just came to mind because the site was writing deprecated OGL code... it was late D:
I'm pretty sure the faded circles are correct. Use this information as a mask.
Like the explanation said, you are not drawing geometry and overlaying light information (which is Overvs approach), but you are drawing light information, and use this as a mask + light information (if I understood right) to draw geometry.
[QUOTE=pikzen;26062459]For resizable array-like objects, you can use java.util.Vector[/QUOTE]
Use ArrayList, not Vector. Vector is an old Java 1.0 class that's inefficient because it's synchronized. ArrayList is part of the newer collections framework that was introduced in Java 1.2.
I want to make a game, but have no idea what to make.
[editline]15th November 2010[/editline]
Overv, is that just pseudocode?
Make an RTS?
[QUOTE=ZenX2;26074172]I want to make a game, but have no idea what to make.
[editline]15th November 2010[/editline]
Overv, is that just pseudocode?[/QUOTE]
Nope, it's code for my Lua game framework. It's part of the following sample:
[media]http://www.youtube.com/watch?v=kF3hbnz85TQ[/media]
In C#
how do i do like i let the user put in 6 numbers and the program tells the defferance on the lowest and highest number ????
[QUOTE=007;26075474]In C#
how do i do like i let the user put in 6 numbers and the program tells the defferance on the lowest and highest number ????[/QUOTE]
Maybe you should start learning an easier language, English for example.
[highlight](User was banned for this post ("Not helpful" - SteveUK))[/highlight]
[QUOTE=DrLuke;26075501]Maybe you should start learning an easier language, English for example.[/QUOTE]
well im not from england so why dont u go learn my language ICELANDIC you try to do that
and what difference does it make how i write defferance
[QUOTE=DrLuke;26075501]Maybe you should start learning an easier language, English for example.[/QUOTE]
Your a dick.
[QUOTE=007;26075509]well im not from england so why dont u go learn my language ICELANDIC you try to do that
[/QUOTE]
:applause:
Matthew, great job on not declaring diff !
[QUOTE=blankthemuffin;26075705]Your a dick.[/QUOTE]
My a dick what ?
[editline]15th November 2010[/editline]
:smug:
[QUOTE=Matthew0505;26075768]Great job quoting the wrong post[/QUOTE]
I didn't want to quote yours
[url]http://www.blackpawn.com/texts/lightmaps/default.html[/url]
What is he referring to with pnode? I know It's pseudocode but It doesn't make too much sense to use pnode->child and then other times just child.
In Node:Insert(), pnode is just referring to the current node. Additionally width and height are referring to img.width and img.height respectively.
If anyone could assist me with [url]http://www.facepunch.com/threads/1026684-Steam-ID-Community-ID-Conversion[/url] I would be very grateful :)
Exactly which line does it hang on ?
Also does the OpenSteamWorks library not have custom ID to ID conversion ? (I don't know, not used OpenSteamWorks - Just a suggestion.)
I'm not entirely sure at which line exactly, but the XML section, ( 32-93 in [url]http://pastebin.com/gvJyQ6xs[/url] ) is what is causing the hang.
As far as I know, the OpenSteamWorks library doesn't have such support, but I'll take a look at it, thanks.
You can use the debugger to get the exact line it hangs on.
I just run your code and noticed a few problems:
1) Line 56 won't be run.
2) The entire try-catch block at lines 58 to 83 don't make sense - It parses textEnterComm.Text as an integer, yet that is a custom URL which is most likely to be text.
I tested it with my steam page and it got to line 52 without any issues and had the correct numerical Steam Community ID.
Hmm thanks. My button code is now:
[code]
private void btnConvertComm_Click(object sender, EventArgs e)
{
if (textEnterComm.Text.StartsWith ("7") && textEnterComm.Text != "")
{
try
{
Int64 communityId = Int64.Parse(textEnterComm.Text);
string sub1 = textEnterComm.Text.Substring(textEnterComm.Text.Length - 1);
int sub11 = int.Parse(sub1);
if (sub11.Equals(0) || sub11.Equals(2) || sub11.Equals(4) || sub11.Equals(6) || sub11.Equals(8))
{
int authServer = 0;
CommunityToSteam(communityId, authServer);
}
else
{
int authServer = 1;
CommunityToSteam(communityId, authServer);
}
}
catch (Exception)
{
//MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
lblSteamOutput.Text = "Invalid Community ID";
}
}
else if (textEnterComm.Text != "")
{
string URLString = "http://steamcommunity.com/id/" + textEnterComm.Text + "?xml=1";
try
{
XmlTextReader reader = new XmlTextReader(URLString);
string sName = "";
string SteamID64 = "";
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
sName = reader.Name;
break;
case XmlNodeType.Text:
switch (sName)
{
case "steamID64":
SteamID64 = reader.Value;
label5.Text = SteamID64;
break;
}
break;
}
/* try
{
Int64 communityId = Int64.Parse(SteamID64);
string sub1 = SteamID64.Substring(SteamID64.Length - 1);
int sub11 = int.Parse(sub1);
if (sub11.Equals(0) || sub11.Equals(2) || sub11.Equals(4) || sub11.Equals(6) || sub11.Equals(8))
{
int authServer = 0;
CommunityToSteam(communityId, authServer);
}
else
{
int authServer = 1;
CommunityToSteam(communityId, authServer);
}
}
catch (Exception)
{
//MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
lblSteamOutput.Text = "Invalid Community ID";
}*/
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
else
{
lblSteamOutput.Text = "No Community ID entered";
}
if (textEnterSteamID.Text != "")
{
try
{
String authServer = textEnterSteamID.Text.Substring(8, 1);
String mainId = textEnterSteamID.Text.Substring(10);
SteamToCommunity(textEnterSteamID.Text.Substring(8, 1), textEnterSteamID.Text.Substring(10), Int64.Parse(authServer), Int64.Parse(mainId));
}
catch (Exception)
{
lblCommID.Text = "Invalid SteamID";
}
}
else
{
lblCommID.Text = "No SteamID entered";
}
}
[/code]
[url]http://pastebin.com/NWr1AW6K[/url]
I commented out the conversion to SteamID from community ID right now, just to see if the correct community ID was retrieved.
Whilst this runs, and does return something, the ID returned does not seem to relate to the custom URL.
I used my custom URL, cherry_jimbo, but it returned 76561197989243780, where it should have returned 76561198003472229
You should break out of the while loop after you find it, currently you are finding your ID then all of your friends' IDs.
Hmm, sorry to sound dumb, but I thought I was already doing that... Care to show me a quick example of what you mean?
[QUOTE=jimbodude;26080848]Hmm, sorry to sound dumb, but I thought I was already doing that... Care to show me a quick example of what you mean?[/QUOTE]
Your break statements apply to the switch statements, not the while loop. Use a couple if statements instead of the switch statements (best solution), or create a variable you can set to false to stop the loop.
[QUOTE=Overv;26075318]Nope, it's code for my Lua game framework. It's part of the following sample:[/QUOTE]
I had a feeling it was Passion. Man that looks useful.
[QUOTE=ZenX2;26082347]I had a feeling it was Passion. Man that looks useful.[/QUOTE]
Thanks. I'm hoping to really prove it's useful by making an actual game soon.
How do I create a simple counter in Java? Like, if I enter a certain number, it will display a line of text that many times
[editline]16th November 2010[/editline]
I am absolutely garbage at programming
[editline]16th November 2010[/editline]
I am absolutely garbage at programming
Get number from a user, store it in userNum
for(int i=0; i<userNum;i+)
{
//write line of text
}
Hey guys, I decided to start learning C++. The basic "Hello, world!" won't compile and I'm wondering why.
[cpp]
#include <iostream>
#include "StdAfx.h"
using namespace std;
int main ()
{
cout << "Hello World! ";
cout << "Good bye world!";
return 0;
}
[/cpp]
what the hell
Sorry, you need to Log In to post a reply to this thread.