Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / October 2003

Tip: Looking for answers? Try searching our database.

move to the next viewpoint

Thread view: 
bart59 - 15 Oct 2003 11:06 GMT
HEllo,
I am trying to make a vrml scene viewer.
Right now I am trying to figure out how to get and move from one
viewpoitn to another one. This view point are defined in the vrml
file, but I don t know how to  do it...
Joerg Scheurich aka MUFTI - 15 Oct 2003 12:39 GMT
> I am trying to make a vrml scene viewer.
> Right now I am trying to figure out how to get and move from one
> viewpoitn to another one. This view point are defined in the vrml
> file, but I don t know how to  do it...

If i understood right, what you want, you can simply use a
positioninterpolator and a orientationinterpolators with the values
from the viewpoint as start and end values. E.g.

#VRML V2.0 utf8

DEF Viewpoint1 Viewpoint
 {
 orientation 0 -1 0 0.142949
 position 0 -0.847810 9.943069
 description "moving"
 }

Transform
 {
 children
   [
   Shape
     {
     appearance       Appearance
       {
       material        Material
         {
         }
       }
     geometry       Cylinder
       {
       }
     }
   ]
 translation -4.251791 -3.051850e-2 -0.446307
 }

Transform
 {
 children
   [
   Shape
     {
     appearance       Appearance
       {
       material        Material
         {
         }
       }
     geometry       Cone
       {
       }
     }
   ]
 translation 4.695546 0 0
 }

Transform
 {
 children
   [
   Shape
     {
     appearance       Appearance
       {
       material        Material
         {
         }
       }
     geometry       Sphere
       {
       }
     }
   ]
 translation 0 4.117030 0
 }

Transform
 {
 children
   [
   Shape
     {
     appearance       Appearance
       {
       material        Material
         {
         }
       }
     geometry       Box
       {
       }
     }
   ]
 translation 0 0 -17.250835
 }

DEF PositionInterpolator1 PositionInterpolator
 {
 key
   [
   0
   1
   ]
 keyValue
   [
   0 0 9.920000
   0 -2.939999 10
   ]
 }

DEF OrientationInterpolator1 OrientationInterpolator
 {
 key
   [
   0
   1
   ]
 keyValue
   [
   0 -0.999997 0 5.235927e-2
   0 -1 0 0.366519
   ]
 }

DEF From Viewpoint
 {
 orientation 0 -1 0 5.235927e-2
 position 0 0 9.920000
 description "From"
 }

DEF To Viewpoint
 {
 orientation 0 -1 0 0.366519
 position 0 -2.939999 10
 description "To"
 }

DEF TimeSensor1 TimeSensor
 {
 cycleInterval 1.960000
 loop TRUE
 }

ROUTE TimeSensor1.fraction_changed TO OrientationInterpolator1.set_fraction
ROUTE TimeSensor1.fraction_changed TO PositionInterpolator1.set_fraction

ROUTE OrientationInterpolator1.value_changed TO Viewpoint1.set_orientation
ROUTE PositionInterpolator1.value_changed TO Viewpoint1.set_position
bart59 - 16 Oct 2003 12:00 GMT
Actually my problem is to get the viewpint FROM the vrml in the
java3D, where I would be able to make the translation.

Otherwise, I am using a vrmlloader (vc97), which doesn't look like to
understand the ROUTE ...

//output:
CyberVRML97 warning : Loading Error (ParseException) =
java.io.InputStreamReader@1a99561
Encountered "ROUTE" at line 21490, column 1.
//end

I tried to remove i manually, but then I've got another error...
java.lang.IllegalArgumentException: IndexedTriangleArray: illegal
indexCount

I am using the 3dsmax vrml exporter.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.