Sign in to follow this  

[Solved] Procedural texture

This topic is 3861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having some troubles getting procedural textures to work, since the only colorchannel working is red. Anyone got some idea of what's wrong? http://rafb.net/p/9uKwx931.html Code in the link. :] [Edited by - S-Rave on May 17, 2007 11:39:32 AM]

Share this post


Link to post
Share on other sites
in your loop where you create the image data i noticed you have your x and y variables accessing the wrong positions in the image array. i realize that it may not matter because the dimensions on your array are both 256. just try swapping the x and y.

Share this post


Link to post
Share on other sites
how about changing the values you store into the RGB channels? does it give a different effect?

for example:
MatrixImage[x][y][0] = 255;
MatrixImage[x][y][1] = 0;
MatrixImage[x][y][2] = 255;

does that give you a magenta color?

Share this post


Link to post
Share on other sites
I just woke up but last time I checked OpenGL expected an array (1D not 3D like yours) of data.

Since it seems you're using C (why?) just malloc width*height*3;

Also: You should also post your code here, a lot of people don't like visiting external links. Read the forum faq on how to do this nicely.

Share this post


Link to post
Share on other sites
Xetick, thnx, Rob pointed me in that direction just before I checked your reply. :D And it works now. :]

Mike2343: I actually don't know why I use C, I just do. :] I'll remember to post the code in here next time too. Thnx! :D

Share this post


Link to post
Share on other sites
Quote:
Original post by Xetick
You set the color to red when you draw it. That might be the problem.
glColor3d(1,0,0);


oh man i feel like an idiot. i cant believe i missed that

Share this post


Link to post
Share on other sites

This topic is 3861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this