right now theres more problems!

* i made the defenition line into "BMAP* MYBMP = "hello.bmp";" as suggested.
* i also put the bmap_lock command inside my "function main()" as instructed.

Now the code works, but just generates an array of objects, disregarding the color of the pixel its supposed to be reading and then using to judge if the color is bright enough it will make a cube! :S

Here is the image its reading:

[img]http://slcrinkle.googlepages.com/hello.bmp[/img]

The probably offending code:

Code:
function new_box()
{
	//bmap_load(MYBMP, "hello.bmp", 0);
	bmap_lock( MYBMP, 0);
	posx=0;
	while (posx<74)
	{
	posx += 2;
	posy=0;
	while (posy<20)
	{
	posy += 2;
	
        // VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
        pixel = pixel_for_bmap(MYBMP,posx,posy); // SHOULd get the bitmaps pixels color
	pixel_to_vec(pixel2, NULL,8888,pixel); // SHOULD change the color to a *vector*
	if (pixel2.x + pixel2.y +pixel2.z > 300)  // IF the result is brighter than a certain amount DO SOMETHING
        // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	{
	box my_box;


EDIT: Never mind i got it working! instead of "8888" i should have used "888"!! My bad! Now if only i could figure them damn structs out!

Last edited by CdeathJD; 09/12/08 13:51.

I am a noob to this... Blitz3D is where i am best at!