Skip to main content

Script for extracting number of actions on object

2 replies [Last post]
strimeno
Offline
Joined: 2010-09-15
Points: 0

Hi to you all!

I am a newbie in Java 3D and I have a strage question.

Lets say that I have a 3D oblject representing a book and then I have certain actions that can be performed on this book like pick up (change coordinates) open, close, etc.

Is there with a script to parse the java file and find the number of actions that can be performed on each object?

So if I have a virtual world, how could I use such a script in order to gather the number of allowed actions for each object??

Thank you so much in advance for your help!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
darwinjob
Offline
Joined: 2004-11-16
Points: 0

>So if I have a virtual world, how could I use such a script in order to gather the number of allowed actions for each object??

As Ralph said, there is no such a script, and it would be extremely difficult to make it "smart" enough. The obvious solution is to add this information (like pickable, closable etc) to the objects as their properties. Then a virtual world (or an avatar) will "know" what actions can be performed on particular object. Praise OOP :)

ralphld
Offline
Joined: 2010-08-02
Points: 0

I don't think you will find a script like that.

A complex act, like opening a book, would be constructed from many simple acts like displaying the two halves of the book pivoting around the spine of the book. The names of the parts of the book would depend on the choices made by the programmer.

You could use grep (under Linux) to easily scan for the number of Shape3D objects or BranchGroups and TransformGroups, but knowing how those components are put together and how they relate to the final image that you see on your screen requires more than a simple counting of the parts.

It would be like trying to tell what a bird can do by looking at a pile of feathers and bones. It's possible, but it takes lots of hard work and study.

HTH,
Ralph