WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-01-2009, 07:17 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
Hi,

I'm sorry but I'm still having problems with this and can't understand why it won't read my array. It is giving the error "TypeError: x must be a float" if I try to convert x to a float (which I thought it already was) I get the error "TypeError: only length-1 arrays can be converted to Python scalars
".

Code:
length = 200
viz.startlayer(viz.LINE_STRIP)
viz.vertexcolor(1,1,1)
viz.linewidth(5)
roadarray = 0.0*np.zeros((length,3))
x = np.linspace(-np.pi, np.pi, length)
z = np.sin(x)
roadarray[:length,0]= x
roadarray[:length,1]= 0
roadarray[:length,2]= z
viz.vertex(roadarray[:length,0],roadarray[:length,1],roadarray[:length,2])
lines = viz.endlayer()
I'd be grateful for any advice on this, I'm not a python expert!

Best, j
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vertex shader performance problem Joran Vizard 2 11-17-2008 01:29 AM
onkeydown list of values Cheff Vizard 2 07-02-2008 02:00 AM
How to get the position of a vertex Jerry Vizard 1 10-04-2006 11:28 AM
get vertex with on the fly object enkeli Vizard 9 05-25-2006 08:27 PM
GLSL / vertex shaders oodini Vizard 1 11-23-2005 10:24 AM


All times are GMT -7. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC