WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 01-21-2015, 03:09 PM
Ryvan Ryvan is offline
Join Date: Jan 2015
Posts: 3
Problem with object position

Hi everyone,

I'm pretty new to vizard so I'm hoping this will be an easy problem to solve!
My code generates the classroom floor found in the demo and when you push the wsda keys it moves you 4 spaces for 5 seconds. I also have a red shape.

The problem is the shape moves with the screen position and I want it to remain fixed! I know that it does this because of this line of code:
#panel is the floor

Does any one know how to solve this problem?
Any comments or tips would be very appreciated!

My code:

This script will demonstrate how to manually animate an object using timers.
import viz
import vizact
import math


import vizinfo

#Add a ground plane


#add shape
#Place the model in front of the viewer
h.setPosition([0,0,13], viz.ABS_GLOBAL)
h.color( viz.RED )
h.transform = None

#hit h and it toggles it away
vizact.onkeydown('h', h.visible, viz.TOGGLE)

def AnimateView(pos):
action = vizact.move(pos,5)

#Setup keyboard events
#move Left
#move Right
#move Forwards
#move Backwards
vizact.onkeydown(' ',AnimateView,(0,0,0))
Reply With Quote
Old 01-22-2015, 04:39 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,471
I don't understand the issue. An action is applied to both the ground object and the viewpoint. Is that what you want? The shape is not being moved. You can check the shape position by adding the following code:

def printShapePosition():
	print h.getPosition(viz.ABS_GLOBAL)
Reply With Quote
Old 01-22-2015, 01:01 PM
Ryvan Ryvan is offline
Join Date: Jan 2015
Posts: 3
Hi! Thanks for your reply.

I'm trying to create a program where a person sees a shape and they toggle it off. Then they move in a certain direction and have to point to the remembered location of the shape, which is then toggled on to see if they are correct.

Currently when I run the program the shape stays centered in the view instead of remaining in a fixed location on the plane. I was hoping that as I moved in any direction that I could move past the shape.

I hope that helps to clarify what I mean.

Thanks for your help!
Reply With Quote

mainview, movement, newb

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
How to get real time position of a object which is connected to a haptic device Melody Vizard 4 09-15-2014 02:35 PM
Create object with position relative to user head, but cannot be obstructed by others Notch Vizard 2 03-03-2014 07:16 AM
Object + InteriaCube + Viewport problem Gekitatsu Vizard 1 02-22-2012 10:55 AM
Can you link the position of a tracker to the orientation of an object? michaelrepucci Vizard 1 09-19-2008 10:23 AM
picking problem... k_iwan Vizard 2 07-27-2007 07:57 PM

All times are GMT -7. The time now is 10:42 PM.

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