ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   General - SDK

Subject: Re: view point handling
Sender: MTelnov 30.07.07 07:59

Hi Dan,

Surely there are workarounds for this Viewpoint problem. But using two identical Viewpoints is one of the simplest and clear methods. Use the following VRML code to test it.

Michael

#VRML V2.0 utf8

DEF V3 Viewpoint {description "V3" position 0 0 30 jump TRUE}
DEF V1 Viewpoint {position 5 2 3 jump TRUE }
DEF V11 Viewpoint {position 5 2 3 jump TRUE }
DEF V2 Viewpoint {position 0 0 3 jump TRUE }
DEF V22 Viewpoint {position 0 0 3 jump TRUE }

Transform
{
    children
    [
        
        Transform {translation 0 0 0 children [ DEF Sphere TouchSensor {} Shape {geometry Sphere {    }
                appearance Appearance {material Material {diffuseColor    0.8 0.1 0.1}}}]}
        Transform {translation 5 2 0 children [ DEF Cone TouchSensor {} Shape {geometry Cone {    }}]}
    
    ]
}    

DEF Scr Script
{
    eventIn SFTime View1
    eventIn SFTime View2
    field SFNode V1 USE    V1
    field SFNode V2 USE    V2
    field SFNode V11 USE V11
    field SFNode V22 USE V22
    field SFBool flag1 FALSE
    field SFBool flag2 FALSE
    directOutput TRUE

    url    "javascript:

    function View1 (val, ts)
    {
        if (flag1 == TRUE)
        {
         V1.set_bind = TRUE;
         flag1 = FALSE;
     }
        else
        {
         V11.set_bind = TRUE;
     flag1 = TRUE;
     }
        

    }

    function View2 (val, ts)
    {
        if (flag2 == TRUE)
        {
         V2.set_bind = TRUE;
         flag2 = FALSE;
     }
        else
        {
         V22.set_bind = TRUE;
     flag2 = TRUE;
     }
    }
    "
}

ROUTE Cone.touchTime TO    Scr.View1
ROUTE Sphere.touchTime TO Scr.View2

 


view point handling / dan.vera@gmail.com / 26.07.07 09:50
     Re: view point handling / nalex@parallelgraphics.com / 26.07.07 11:50
         Re: view point handling / dan.vera@gmail.com / 28.07.07 08:06
             Re: view point handling / dan.vera@gmail.com / 30.07.07 01:13
                 Re: view point handling / MTelnov / 30.07.07 07:59

Messages in thread: 5


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.