WorldViz User Forum How to draw a circle?
 Register FAQ Search Today's Posts Mark Forums Read

#1
05-04-2011, 06:15 AM
 Saz Member Join Date: Nov 2008 Posts: 36
How to draw a circle?

Hi,

I'm trying to draw two flat circles side by side on which I need to put textures on (a sphere is no good due to the curvature). Is there a simple command to create a circle in Vizard (I have looked but the nearest so far is a sphere) or would I have to use an mathematical operator to do this?

Thanks
#2
05-04-2011, 07:31 PM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,455
You could create circular images in an image editor and apply those to a texture quad. Use an image format that supports alpha channels to make the areas outside the circle transparent.

The Python Imaging Library has functions to draw 2D shapes but I'm not sure if you can easily add textures to them.
#3
05-04-2011, 07:33 PM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,455

http://kb.worldviz.com/articles/470
#4
05-05-2011, 04:58 AM
 Saz Member Join Date: Nov 2008 Posts: 36
Hi Jeff,
thanks for that, I've decided to use to quads and apply the textures to them instead. I'm trying to code for the textures in these two quads to both move at independent speeds in a downward motion (like lines moving down a page). In the past I've used the viz.MainView.move command but obviously that moves the whole viewpoint and so the whole quad moves (and then disappears) rather than the textures inside them.

Here is the code written so far:
Code:
```import viz
#Import vizjoy module
import vizjoy
import time
import math
import vizact
import vizinfo
import vizshape

viz.displaymode(1024, 512)
viz.go(viz.FULLSCREEN)
viz.mouse(viz.OFF)
vizact.ontimer(32,viz.quit) #runs file for 32 secs

subject = viz.input('What is the participant number?')

#define speed
MOVE_SPEED = 0.1041 #scalar constant for speed gain

viz.clearcolor(0.5,0.5,0.5)
viz.MainView.setPosition(0,.5,0)

#and place it over ground

#and place it over ground

viz.MainView.move(0,0,MOVE_SPEED,viz.BODY_ORI)

#call a timer every frame to check if road needs to be added
Is there tutorial that explains how to assign different speeds (or speeds at all) to the textures inside quads? Any help is much appreciated
Thanks
#5
05-05-2011, 03:25 PM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,455
You can try changing the texture coordinates to move the image on the quad. In the Textures section of Vizard Teacher in a Book, available from our downloads page, there is an example that moves clouds across a window by manipulating the texture coordinates of the window object.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post Chrissy2009 Vizard 9 08-24-2009 11:12 AM Chrissy2009 Vizard 1 07-21-2009 09:46 AM Chrissy2009 Vizard 2 05-30-2009 12:50 AM Chrissy2009 Vizard 2 05-13-2009 04:42 AM Johannes Vizard 7 01-07-2005 02:50 PM

All times are GMT -7. The time now is 08:43 PM.