WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-07-2016, 08:13 PM
hsc hsc is offline
Member
 
Join Date: Aug 2016
Posts: 2
Walking Down the Stairs

Hi all,

I've been trying to create a falling from stairs scenario, but the my functions doesn't work as expected. The relevant code is below. Once the fall function is activated the main view moves forward and down repeatedly (bumping), but instead of going down the stairs, it's stuck in the original position. The "if" loop isn't working either.
Now I'm stuck with it and have no idea how to modify the code. Please help me if you see what the problems are. Thank you.


Code:
#Bumping
def bump():
	i=1
	while (i<10):
		position = viz.MainView.getPosition()
		position[1]+= -.5
		action1 = vizact.goto(position,0.1,viz.TIME)
		yield viz.MainView.addAction(action1)
				
		position = viz.MainView.getPosition()
		position[0]+= .5
		action2 = vizact.goto(position,0.1,viz.TIME)
		yield viz.MainView.addAction(action2)
		
		i+=1

#Spinning
def spin(e):
			euler = viz.MainView.get(viz.HEAD_EULER)
			euler[0] += e.dx*3
			euler[1] += -e.dy*3
			euler[0] = viz.clamp(euler[0],10.0,190.0)
			euler[1] = viz.clamp(euler[1],-60.0,60.0)
			viz.MainView.setEuler(euler,viz.HEAD_ORI) 

#Fall
def fall():
	position2 = viz.MainView.getPosition()
	orientation2 = viz.MainView.getEuler()
	if 2.1< position2[1] <5.5:	
		viz.MainView.collision(viz.OFF)
		viz.callback(viz.MOUSE_MOVE_EVENT,spin)
		viztask.schedule(bump())
vizact.ontimer(0,fall)
Reply With Quote
  #2  
Old 08-09-2016, 05:59 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
Take a look at the viewpoint collision and gravity commands. Does that work for you?
Reply With Quote
  #3  
Old 08-09-2016, 08:15 PM
hsc hsc is offline
Member
 
Join Date: Aug 2016
Posts: 2
Hi Jeff, I set my collision and gravity as follows:

The MainView still doesn't go down the stairs instead just 'bumps" at one location only. I tried to change the gravity and turn off collision but still the same

# viz.MainView.collision(viz.ON)
viz.MainView.stepsize(0.6)
viz.MainView.gravity(20)
#
Reply With Quote
  #4  
Old 08-12-2016, 01:40 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
Can you post a working example that reproduces the issue?
Reply With Quote
Reply

Tags
# [code][/code]

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
Walking action of avatars SivaKartheek Vizard 3 01-08-2016 09:17 AM
Regarding Walking Action of Avatars SivaKartheek Vizard 2 12-10-2015 08:10 AM
Problem making avatar climb stairs SUJITH_KJ Vizard 8 01-20-2015 05:38 AM
Bouncing point of view during walking seal Vizard 2 10-21-2013 08:02 AM
Walking avatars --> collision detection? sjroorda Vizard 3 10-13-2005 04:47 AM


All times are GMT -7. The time now is 09:04 PM.


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