ParallelGraphics Forums
Cortona VRML Client
You are here: [Forums]::[Browsers]::[Cortona VRML Client]

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:
   Browsers - Cortona VRML Client

Subject: strange floating point behaviour (bug?)
Sender: normca@yahoo.ca 16.07.07 11:49


When I assign a floating point value to an SFRotation script variable, a small number is added to that value.

for example see Twist[3] in the script below.

DEF    MoveControl Script {
    eventIn            SFBool        Signal
    eventOut        SFRotation    Twist

    url "javascript:

    function Signal(bool) {
        if (bool == TRUE) {
            Twist[0] = 0;
            Twist[1] = 1;
            Twist[2] = 0
            Twist[3] = 3.14;
        }
    }
    "
}

However, the value of Twist[3] is not 3.14; it's 3.140000104904175. What's even stranger is that the value of Twist is 0 1 0 3.14 !!

Below I show the content of VRMLPad's "Immediate" window while in debugging mode.

Twist;
0 1 0 3.14
Twist[3];
3.140000104904175

(By the way, VRMLPad is great!)

Looks like a bug to me, but maybe there's something I don't understand.

norm

 


strange floating point behaviour (bug?) / normca@yahoo.ca / 16.07.07 11:49
     Re: strange floating point behaviour (bug?) / nalex@parallelgraphics.com / 17.07.07 06:34

Messages in thread: 2


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