psilos

06-09-2004, 01:39 AM

I want to create a functional texture of marble and wood!!How can i do this?

I would appreciate if there is any sample code

thnx!

I would appreciate if there is any sample code

thnx!

View Full Version : Functional texture generation

psilos

06-09-2004, 01:39 AM

I want to create a functional texture of marble and wood!!How can i do this?

I would appreciate if there is any sample code

thnx!

I would appreciate if there is any sample code

thnx!

dvm

06-09-2004, 04:17 AM

What do you mean by functional? You could do a search on google and find a marble or wood image and then with an image manipulation program (the gimp is free) you can twist it around to what you want.

If you want to create a texture with mathematical functions then you should look for fractal generation.

Ela re Elladara!

If you want to create a texture with mathematical functions then you should look for fractal generation.

Ela re Elladara!

arekkusu

06-09-2004, 04:47 AM

The term is "procedural". Fractals are one of many approaches.

See http://www.threedgraphics.com/texsynth/

See http://www.threedgraphics.com/texsynth/

psilos

06-10-2004, 12:43 AM

thanks for the advices,but i want to create a 3D texture T(s,t,r) that is set in 3D space so that the object i want to create in this space(area) will look as if it was sculptured from a real material.I know that there is a function f_marble(P)=sin(2πx + 2πa*f_turb(P)) but i dont know how to illustrate it.

Thnx!

P.S.:Geia sou Ellada

Thnx!

P.S.:Geia sou Ellada

arekkusu

06-10-2004, 06:23 PM

Mmyep. Did you follow the links?

For example

http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

http://graphics.lcs.mit.edu/~legakis/MarbleApplet/marbleapplet.html

Seriously google can find this in like three seconds, it really can.

For example

http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

http://graphics.lcs.mit.edu/~legakis/MarbleApplet/marbleapplet.html

Seriously google can find this in like three seconds, it really can.

psilos

06-11-2004, 11:48 AM

well i have searched the links and in google,but i cannot found any particular code,they all describe algorithms in general.I search noise function and turbulence illustrated in opengl code. :(

06-11-2004, 04:52 PM

it's in there. the links that arekkusu provided are excellent, the perlin one in particlar. there's even an example of the marble function there, only it's in 3d, which will require you to use your imagination a little :) .

for 3d noise, you can think of the z as a stack of 2d pancakes. use the z to lookup the right pancake in the stack. it might fall between two pancakes, in that case, you interpolate, just like in 2d.

for 3d noise, you can think of the z as a stack of 2d pancakes. use the z to lookup the right pancake in the stack. it might fall between two pancakes, in that case, you interpolate, just like in 2d.

psilos

06-21-2004, 07:27 AM

I have finally create a function for marble but i don't know how can i use it in opengl!!

The function takes a point(x,y,z) and returns a float value for that point!In order to create an image from this function should i do something like:

GLubyte check[512][512][3];

int i,j;

for (i = 0; i < 512 i++) {

for (j = 0; j < 512; j++) {

c = function_marble;

check[i][j][0] = (GLubyte) c;

check[i][j][1] = (GLubyte) c;

check[i][j][2] = (GLubyte) c;

check[i][j][3] = (GLubyte) 255;

}

}Thanx for any help!

The function takes a point(x,y,z) and returns a float value for that point!In order to create an image from this function should i do something like:

GLubyte check[512][512][3];

int i,j;

for (i = 0; i < 512 i++) {

for (j = 0; j < 512; j++) {

c = function_marble;

check[i][j][0] = (GLubyte) c;

check[i][j][1] = (GLubyte) c;

check[i][j][2] = (GLubyte) c;

check[i][j][3] = (GLubyte) 255;

}

}Thanx for any help!

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.