This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > September 2004 > help with simple vrml code





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 help with simple vrml code
Robert Smith

2004-09-15, 11:53 pm

I am just getting started in VMRL and I want to play around a bit.

I have a box (see attached code) and I want to put a white strip down the
center of the box like it was painted on. How can I do this?



#VRML V2.0 utf8

Group {

children

[

Shape

{

appearance Appearance

{

material Material

{

diffuseColor 0.3 0.4 0.6

}

}

geometry Box

{

size 10.0 0.3 6.0

}

}

]

}



Thanks


Joerg Scheurich aka MUFTI

2004-09-16, 10:27 am

> I have a box (see attached code) and I want to put a white strip down the
> center of the box like it was painted on. How can I do this?


To point color on a 3D object, use a Texture.
You can use a ImageTexture with a jpg/png imagefile or a PixelTexture with
numbers.

#VRML V2.0 utf8

Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
texture PixelTexture
{
image 3 2 3
0x00808080
0x00ffffff
0x00808080
0x00808080
0x00808080
0x00808080
}
}
geometry Box
{
}
}
]
}

Sponsored Links


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