This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > December 2003 > accessing Fields in Java
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 |
accessing Fields in Java
|
|
| Junaid 2003-12-21, 11:49 pm |
| Im making a program with VRML and Scripts written in Java.
I have basically created a semitransparent box with atoms(Spheres) inside
it. I have written a script in Java which provides the VRML with coordinates
for the atos. The Script also does collision detection.This works fine.
However the next stage in my project is to access the radius of each atom so
that collision detection works on atoms of any size.
I have a PROTO Component which defines an atom, however i cannot have an
'exposedField myRadius' as radius (in Sphere) is a Field, but if i call it a
Field in my PROTO then I cant access it in Java. I have tried to use
'exposedField SFNode geometry'
and then try to access this in Java but no luck. Is there any way out?
I would be more than grateful if anyone can help.
Thanks.
| |
| Herbert Stocker 2003-12-22, 2:29 am |
|
Junaid wrote:quote:
> Im making a program with VRML and Scripts written in Java.
>
> I have basically created a semitransparent box with atoms(Spheres) inside
> it. I have written a script in Java which provides the VRML with coordinates
> for the atos. The Script also does collision detection.This works fine.
> However the next stage in my project is to access the radius of each atom so
> that collision detection works on atoms of any size.
>
> I have a PROTO Component which defines an atom, however i cannot have an
> 'exposedField myRadius' as radius (in Sphere) is a Field, but if i call it a
> Field in my PROTO then I cant access it in Java. I have tried to use
> 'exposedField SFNode geometry'
> and then try to access this in Java but no luck. Is there any way out?
>
> I would be more than grateful if anyone can help.
> Thanks.
>
You can set radius to 1, place it inside a Transform and use the scale
field of that transform to size the Sphere. scale is an exposedField.
The drawback is that you must specify the radius three times.
The advantage is that you can have elliptical atoms (i don't think
this is usefull :-) )
Herbert
--
Herbert Stocker (aka hersto)
http://www.hersto.de
www.bitmanagement.de
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|