[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [x3d-public] Import/Export Example



Can one multiply import from the same file, thus?

IMPORT MVB_INLINE.POSTION_INTERP AS PI1
IMPORT MVB_INLINE.POSTION_INTERP AS PI2
IMPORT MVB_INLINE.POSTION_INTERP AS PI3

ROUTE PI1.value_changed TO TG1.set_translation
ROUTE PI.2value_changed TO TG2.set_translation
ROUTE PI.3value_changed TO TG3.set_translation

And can these imported nodes be accessed via SAI the same as DEF'ed ones?
ie: getNode ("PI1")
?

Dave A.


Alan Hudson wrote:

Xj3D has implemented the import/export capabilities of the X3D specification. We've made a small set of simple examples to get the ball rolling on using these new features.

Import/Export allows you to expose fields from an Inline to its parent. Basically making an Inline have a small interface similar to a proto. It was felt that this interface would make content creation easier. In your Inline you EXPORT the fields you want exposed. In the parent scene you IMPORT those names and then you can ROUTE to them as desired.
You can find the examples here:


http://www.xj3d.org/examples/

You will need the latest dev release version of Xj3D to run this. Our dev releases now provide user installers, they are available here:

http://www.xj3d.org/snapshots.html

A simple example of the parent file would be:
#X3D V3.0 utf8

PROFILE Immersive

DEF TG Transform {
 rotation 0 1 0 0.78
 children [...]
}

DEF MVB_INLINE Inline {
 url "moving_box_export2.x3dv"
}

IMPORT MVB_INLINE.POSTION_INTERP AS PI

ROUTE PI.value_changed TO TG.set_translation

---
The inline would look like this:
#X3D V3.0 utf8

PROFILE Immersive

DEF TS TimeSensor {
 cycleInterval 10
 loop TRUE
}

DEF PI PositionInterpolator {
 key [ 0 0.25 0.5 0.75 1 ]
 keyValue [
    0 0 0
   -1 0 0
   -1 1 0
    0 1 0
    0 0 0
 ]
}

ROUTE TS.fraction_changed TO PI.set_fraction

EXPORT PI AS POSTION_INTERP

-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html


-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html