This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > January 2005 > is this possible?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author is this possible?
mdk

2005-01-06, 12:20 pm

Hello,
I just want to make sure that it's not possible (unfortunately):

Let's say I have a texture and a face. I'd like to texture this face
but only with some part of my texture - for example I want to use a subrectangle
of my texture with coordinates 0.4,0.4 x 0.7,0.8 (lower left x upper right).
But I want this subrectangle to repeat many times in X and Y directions.
(I don't want other parts of texture to be visible).

is this possible?

md
marcin

2005-01-06, 12:20 pm

Użytkownik mdk napisał:
> Hello,
> I just want to make sure that it's not possible (unfortunately):
>
> Let's say I have a texture and a face. I'd like to texture this face
> but only with some part of my texture - for example I want to use a
> subrectangle
> of my texture with coordinates 0.4,0.4 x 0.7,0.8 (lower left x upper
> right).
> But I want this subrectangle to repeat many times in X and Y directions.
> (I don't want other parts of texture to be visible).
>


Yes its posssible , but only on IndexedFaceSet and ElevationGrid.
You must use TextureCoordinate node for adjustable part of texture
to subshape.
in example if you want repeat texture five times in one direction
You need five subshape in this direction.
sorry for poor answer but I'm sleeeepy :-0


--

Pozdrawiam/Regards

Marcin Starzykowski
_____________________________________________
www.vrml.enter.net.pl
Ostatnia aktualizacja 09.11.2004
Last update 09.11.2004
_____________________________________________
marcin

2005-01-06, 12:20 pm

Hello

I found old example file , maybe it can help you.
Oh one more things : you dont need a lot of subshape
you can use scale field in TextureTransform node.

#tekstura nałożona przez indeksowanie punktów

Shape {
appearance Appearance {texture ImageTexture
{url "tu wstaw jakąś teksturę"}}
geometry IndexedFaceSet {
coord Coordinate {
point [
1,1,0
-1 ,1,0
-1 , -1 , 0
1, -1 ,0
]}

coordIndex [

0,1,2,3,0,-1
0,3,2,1,0,-1
]

texCoord TextureCoordinate {
point [#tu są punkty na teksturze
0 ,0
0.5 , 0
0.5 , 0.5
0 , 0.5
]
}
texCoordIndex [

0,3,2,1,0,-1
0,3,2,1,0,-1

]

}}


--

Pozdrawiam/Regards

Marcin Starzykowski
_____________________________________________
www.vrml.enter.net.pl
Ostatnia aktualizacja 09.11.2004
Last update 09.11.2004
_____________________________________________
Joerg Scheurich aka MUFTI

2005-01-06, 12:20 pm

> Yes its posssible , but only on IndexedFaceSet and ElevationGrid.

Or (in case of VRML97 Amendment 1) NurbsSurface, which has a
TextureCoordinate node as well.

so long
MUFTI
--
(Press Retry to debug the application - JIT must be enabled)
Abbrechen Wiederholen Ignorieren
aus einer M$Windows "assert" Fehlermeldung
mdk

2005-01-07, 4:16 am

Hi,

> Yes its posssible , but only on IndexedFaceSet and ElevationGrid.
> You must use TextureCoordinate node for adjustable part of texture
> to subshape.
> in example if you want repeat texture five times in one direction
> You need five subshape in this direction.


Do you mean to subdivide my IFS into 5 smaller IndexedFaceSets? Well, it would
actually solve this problem but is there any way to do it
without increasing complexity of the scene?

md
marcin

2005-01-07, 4:16 am

Użytkownik mdk napisał:

> Hi,
>


> Do you mean to subdivide my IFS into 5 smaller IndexedFaceSets? Well, it
> would
> actually solve this problem but is there any way to do it
> without increasing complexity of the scene?
>
> md


Helo

No , no , no it was my error.
Read upper post.
Ypu can use TextureCoordinate for cut-off
smaller part from texture, and use "scale" field
in TextureTransform for multiplication texture
in both direction.


--

Pozdrawiam/Regards

Marcin Starzykowski
_____________________________________________
www.vrml.enter.net.pl
Ostatnia aktualizacja 09.11.2004
Last update 09.11.2004
_____________________________________________
mdk

2005-01-07, 4:16 am

> No , no , no it was my error.
> Read upper post.
> Ypu can use TextureCoordinate for cut-off
> smaller part from texture, and use "scale" field
> in TextureTransform for multiplication texture
> in both direction.


Ok, now I see - but I already tried this method and it didn't
work. The problem is that TextureTransform is probably applied
before TextureCoordinate.

So the question is still open - is it possible to do it?

Below is the solution you suggest I suppose:

#VRML V2.0 utf8

Shape {
geometry IndexedFaceSet {
coord Coordinate {
point [
1 1 0, -1 1 0, -1 -1 0, 1 -1 0
]
}
coordIndex [
0 1 2 3 -1
]
texCoord TextureCoordinate {
point [
0.6 0.6, 0.4 0.6, 0.4 0.4, 0.6 0.4
]
}
texCoordIndex [
0 1 2 3 -1
]
}
appearance Appearance {
texture ImageTexture {
url [
"rock.gif"
]
}
textureTransform TextureTransform {
scale 10 10
}
}
}



md

p.s. happy new year everyone ;)
marcin

2005-01-07, 11:16 pm

Użytkownik mdk napisał:

> Ok, now I see - but I already tried this method and it didn't
> work. The problem is that TextureTransform is probably applied
> before TextureCoordinate.
>
> So the question is still open - is it possible to do it?
>
> Below is the solution you suggest I suppose:
>
> #VRML V2.0 utf8
>


Hello

This is solution of your problem :-))

(...)
appearance Appearance {
texture ImageTexture {
repeatS TRUE # add this line
repeatT TRUE # and add this line
url [
"stone.gif"
]
}
textureTransform TextureTransform {

scale 10 10
}
(...)



--

Pozdrawiam/Regards

Marcin Starzykowski
_____________________________________________
www.vrml.enter.net.pl
Ostatnia aktualizacja 29.12.2004
Last update 29.12.2004
_____________________________________________
mdk

2005-01-08, 4:17 am

> Hello
>
> This is solution of your problem :-))
>
> (...)
> appearance Appearance {
> texture ImageTexture {
> repeatS TRUE # add this line
> repeatT TRUE # and add this line


Yeah, but these are the default values so why should I add them?
Anyway I tried that too and it doesn't work either - at least with
Cortona and Octaga - what browser do you have? Does it work for you?

To clarify it a bit more I've made a simple explanation:

http://atos.wmid.amu.edu.pl/~d115738/vrml/problem.html

First enlarging then repeating (below) doesn't work either... :/


#VRML V2.0 utf8
Shape {
geometry IndexedFaceSet {
coord Coordinate {
point [
1 1 0, -1 1 0, -1 -1 0, 1 -1 0
]
}
coordIndex [
0 1 2 3 -1
]
texCoord TextureCoordinate {
point [
# 1 1, 0 1, 0 0, 1 0 # try this too
10 10, 0 10, 0 0, 10 0
]
}
texCoordIndex [
0 1 2 3 -1
]
}
appearance Appearance {
texture ImageTexture {
url [
"t1.jpg"
]
repeatS TRUE
repeatT TRUE
}
textureTransform TextureTransform {
scale 0.05 0.05
translation 8.9 9.9
}
}
}

Texture t1.jpg is on the webpage mentioned above.

Any ideas?

md
marcin

2005-01-08, 4:17 am

Użytkownik mdk napisał:
>
>
> Yeah, but these are the default values so why should I add them?
> Anyway I tried that too and it doesn't work either - at least with
> Cortona and Octaga - what browser do you have? Does it work for you?
>
> To clarify it a bit more I've made a simple explanation:
>
> http://atos.wmid.amu.edu.pl/~d115738/vrml/problem.html


> textureTransform TextureTransform {
> scale 0.05 0.05
> translation 8.9 9.9
> }
> }


Change scale field as below

textureTransform TextureTransform {
scale 20 20
}
}

--
Marcin Starzykowski www.vrml.enter.net.pl
Aktualizacja 29.12.2004 Last update 29.12.2004
marcin

2005-01-10, 7:15 am

Użytkownik mdk napisał:
>
>
> Yeah, but these are the default values so why should I add them?
> Anyway I tried that too and it doesn't work either - at least with
> Cortona and Octaga - what browser do you have? Does it work for you?
>
> To clarify it a bit more I've made a simple explanation:
>
> http://atos.wmid.amu.edu.pl/~d115738/vrml/problem.html


> textureTransform TextureTransform {
> scale 0.05 0.05
> translation 8.9 9.9
> }
> }


Change scale field as below

textureTransform TextureTransform {
scale 20 20
}
}

--
Marcin Starzykowski www.vrml.enter.net.pl
Aktualizacja 29.12.2004 Last update 29.12.2004
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews