This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > December 2004 > Obtain dimensions....





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Obtain dimensions....
bensmyth

2004-12-28, 7:17 pm

This is difficult to explain, so I'll cut-to-the-chase....

Is there a way to write the following js function:

function vectorLength(vector)
{
var length = 0;

for (var i = 0; i < vector.LENGTH; i++)
length += vector[i];

length = Math.sqrt(length);

return length;
}


vector.LENGTH is obviously undefined...... vector could be either SFVec3f or
SFVec2f or ...... is there a dynamic method to get the length??? (I'm
assuming not.... but thought I might as well ask!)


Cheers,

Ben


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews