This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > December 2004 > SFString





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 SFString
Matt

2004-12-19, 7:16 pm

I've tried passing an SFString into a prototype and using that to control
the name of a viewpoint created within the prototype, so that I don't end
with many different viewpoints all with the same name.

I've tried using the following code:

######################################### car.wrl
PROTO Car [
exposedField SFString view_name "Inside"
]
{
.....
Transform {
rotation 0 1 0 -1.571
children [
Transform {
rotation 0 1 0 -1.541
translation -15 5 0
children [
Viewpoint {
description IS view_name <------ IS statement:
category mismatch
orientation 0 0 0 0
position 0 0 0
}
]
}
]
}
.....
}

######################################### main.wrl
EXTERNPROTO Car [
exposedField SFString view_name
]"car.wrl#Car"
....
Transform {
rotation 0 1 0 3.142
children [
Car {
view_name "A"
}
]
}

Transform {
rotation 0 1 0 3.142
children [
Car {
view_name "B"
}
]
}


But it does not work and produces these errors:
Error in definition of PROTO Lego_Car
<file>...\car.wrl#car : IS statement: category mismatch



Does anyone have any ideas why this does not work?

Cheers.


Josip Almasi

2004-12-19, 7:16 pm

Matt wrote:

> I've tried passing an SFString into a prototype and using that to control
> the name of a viewpoint created within the prototype, so that I don't end
> with many different viewpoints all with the same name.
>
> I've tried using the following code:
>
> ######################################### car.wrl
> PROTO Car [
> exposedField SFString view_name "Inside"
> ]

....
> Viewpoint {
> description IS view_name <------ IS statement:


Description isn't exposedField.

Regards...
Sponsored Links


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