wandPosition Examples: Moving and Scaling

1: Move a cube around when you press button 1

/* 
	move a cube around when you press the button.
*/

#include "User0"

light (position(1 -1 1))

object cube1 (file(cube.pfb))

wandPosition(volume(infinite),
	when(button1,cube1.position($xpos $ypos $zpos)))

2: Make a cube change height as you move the wand up and down

/* 
	change size as you move the wand up and down
	note that values of 0 or less than 0 are bad for the size message ...
*/

#include "User0"

light (position(1 -1 1))

object cube1 (file(cube.pfb),position(0 10 0))

wandPosition(volume(infinite),
	when(inside,cube1.size(1 1 $zpos)))
 

(c) Ben Chang