My News
Moderator: Moderators
- BlackLiger
- Posts: 1371
- Joined: 05 Oct 2004, 21:58
My News
http://www.bolton.ac.uk/courses/course_ ... ode=single
This is a real university course and im lookin at it seriously. So if spring is still goin in about 2 years time, you will have a new team member SY (asside from my unofficial work in sortin out the OTA music into a setup you can use)
This is a real university course and im lookin at it seriously. So if spring is still goin in about 2 years time, you will have a new team member SY (asside from my unofficial work in sortin out the OTA music into a setup you can use)
-
- Posts: 436
- Joined: 26 Aug 2004, 08:11
Good for you! These topics are incredible... the classes can give you the information but games development is yet another step above that. Practice practice practice! Write demos, read books, etc. Premier Press's "Game Development Series" of books are invaluable to learn more on these topics and get a look at in depth methods actually used today (http://www.premierpressbooks.com/ptr_ca ... ment&all=1) I personally have 7 or 8 of these.[/url]
-
- Posts: 128
- Joined: 24 Feb 2005, 19:05
-
- Posts: 436
- Joined: 26 Aug 2004, 08:11
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
- BlackLiger
- Posts: 1371
- Joined: 05 Oct 2004, 21:58
Actully, youre almost right! Its aGorm Isafol. It stems from the following:
A (obvious...) Gorm (comes from the word gormless : This is a good old Lancashire dialect word meaning ├óÔé¼┼ôlacking sense or discernment├óÔé¼┬Ø. ) is a Fool (a person who behaves in a silly way without thinking)
I couldn't stand school and I certanly cant be doin with computers, which is why I work with computers all day. (ask almost anyone in the IT proffesion, they all hate computers...). Which is why i'd never be able to get a qualification in them... Im miles away from manchester...
aGorm
A (obvious...) Gorm (comes from the word gormless : This is a good old Lancashire dialect word meaning ├óÔé¼┼ôlacking sense or discernment├óÔé¼┬Ø. ) is a Fool (a person who behaves in a silly way without thinking)
I couldn't stand school and I certanly cant be doin with computers, which is why I work with computers all day. (ask almost anyone in the IT proffesion, they all hate computers...). Which is why i'd never be able to get a qualification in them... Im miles away from manchester...
aGorm
- [K.B.] Napalm Cobra
- Posts: 1222
- Joined: 16 Aug 2004, 06:15
The only way to learn how to programme is to do it, sure you'll probably crash your computer once or twice, or if your like me an unholy amount, but it will help you learn a tremendously.i dont plan on touching the code till i learn some.
P.S. Mind asking your tutor/teacher/lecturer what values glReadPixels actually puts in the pointer you pass to it?
-
- Posts: 436
- Joined: 26 Aug 2004, 08:11
it depends on the byte format you request, as well as which buffer you want to get the data from (ie stencil, depth, etc). It gets the data from the current rendering context (basically, what you are currently rendering to) from the rectangle you specify. Taken directly from the man pages, the arguments are as follows.
void glReadPixels(GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid *pixels)
PARAMETERS
x, y Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.
width, height Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.
format The format of the returned pixel data. The allowable values are GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA, GL_BGR_EXT, GL_BGRA_EXT, GL_ARGB_I3D, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, and GL_422_REV_AVERAGE_EXT.
type Specifies the data type for pixel data. The allowable values are GL_BITMAP, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2_EXT, GL_UNSIGNED_BYTE_2_3_3_REV_EXT, GL_UNSIGNED_SHORT_5_6_5_EXT, GL_UNSIGNED_SHORT_5_6_5_REV_EXT, GL_UNSIGNED_SHORT_4_4_4_4_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_UNSIGNED_SHORT_5_5_5_1_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_UNSIGNED_INT_8_8_8_8_EXT, GL_UNSIGNED_INT_8_8_8_8_REV_EXT, GL_UNSIGNED_INT_10_10_10_2_EXT, and GL_UNSIGNED_INT_2_10_10_10_REV_EXT.
pixels Returns the pixel data.
hopefully these are self explanatory :)
void glReadPixels(GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid *pixels)
PARAMETERS
x, y Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.
width, height Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.
format The format of the returned pixel data. The allowable values are GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA, GL_BGR_EXT, GL_BGRA_EXT, GL_ARGB_I3D, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, and GL_422_REV_AVERAGE_EXT.
type Specifies the data type for pixel data. The allowable values are GL_BITMAP, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2_EXT, GL_UNSIGNED_BYTE_2_3_3_REV_EXT, GL_UNSIGNED_SHORT_5_6_5_EXT, GL_UNSIGNED_SHORT_5_6_5_REV_EXT, GL_UNSIGNED_SHORT_4_4_4_4_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_UNSIGNED_SHORT_5_5_5_1_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_UNSIGNED_INT_8_8_8_8_EXT, GL_UNSIGNED_INT_8_8_8_8_REV_EXT, GL_UNSIGNED_INT_10_10_10_2_EXT, and GL_UNSIGNED_INT_2_10_10_10_REV_EXT.
pixels Returns the pixel data.
hopefully these are self explanatory :)
- [K.B.] Napalm Cobra
- Posts: 1222
- Joined: 16 Aug 2004, 06:15
So if I put in...
That will return me the red ranging from 0-255 of the pixel I clicked?
And therefore if I set that pixels colour by an array item number then the red value should be the same as my the array number used to define it? and therefore I can use it to access the array element?
Code: Select all
glReadPixels(x, y, 1, 1, GL_RED, GL_UNSIGNED_BYTE, &pixel);
And therefore if I set that pixels colour by an array item number then the red value should be the same as my the array number used to define it? and therefore I can use it to access the array element?
-
- Posts: 436
- Joined: 26 Aug 2004, 08:11
- [K.B.] Napalm Cobra
- Posts: 1222
- Joined: 16 Aug 2004, 06:15
Index buffer? Hahaha, fat chance.
No, seriously my OGL skills aren't quite up to fiddling with buffers, I'm using it to figure out what point in a height map that I clicked, ie, if you click x5,y3 you would have clicked heightmap[x*width+y], so I could then go heightmap[x*width+y]+=0.1; etc etc. To define the selection box colour I used glColor3f(var,var,var); with var=x*width+y;.
No, seriously my OGL skills aren't quite up to fiddling with buffers, I'm using it to figure out what point in a height map that I clicked, ie, if you click x5,y3 you would have clicked heightmap[x*width+y], so I could then go heightmap[x*width+y]+=0.1; etc etc. To define the selection box colour I used glColor3f(var,var,var); with var=x*width+y;.
-
- Posts: 436
- Joined: 26 Aug 2004, 08:11