How to build a vector from two floats?

Mike Fletcher mfletch at tpresence.com
Tue Aug 29 06:32:28 EDT 2000


Not really sure what library you're using, I'm guessing it's something
inside JPython, as the code doesn't look like its relating to Cortona's
automation interface, and it is definitely not anything in mcf.vrml.  I
would suggest giving a more complete description of the problem, including
what library you're using, preferably including a description or pointer to
documentation on the TypedField class you're using in this code.

Good luck,
Mike

-----Original Message-----
From: Fredrik Lundin [mailto:m94lufr at mtek.chalmers.se]
Sent: Tuesday, August 29, 2000 3:52 AM
To: python-list at python.org
Subject: How to build a vector from two floats?


Hey!

I am experiencing problems when I want to build a vector out of two floats.
I am routing two SFFloats from a WRL-file to the python script.

The function looks like this:

class TextureScale(TypedField(SFVec2f,(SFFloat,SFFloat))):
  def evaluate(self, inputs):
    return inputs[0].get(),inputs[1].get()
texturescale = TextureScale()

Shouldn't the return be of the type SFVec2f with two SFFloat in x- &  y-pos?


-- 
http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list