WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-30-2018, 02:45 PM
Lenticularis Lenticularis is offline
Member
 
Join Date: Jul 2016
Posts: 12
Question Accelerated motion

Is there a simple solution to implement accelerated motion in Vizard?

Or do I have to use the normal vizact.move function and combine it with the formula "v = a · t + v"?

Any ideas?
Reply With Quote
  #2  
Old 05-30-2018, 03:22 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Are you moving the viewpoint or some objects? Can you describe a bit the application you are creating?
Reply With Quote
  #3  
Old 05-31-2018, 06:13 AM
Lenticulariss Lenticulariss is offline
Registered User
 
Join Date: May 2018
Posts: 1
Objects. I want to move an object (let's say a car) forward for a certain duration and with a certain average velocity. But with accelerated movement, not with constant velocity.

Example: vizact.move(0,0,6, velocity)
--> In this function I can define the direction of movement and the duration of the movement, I can also specify a certain velocity. But now I want to accelerate this movement by let's say 1 m/s^2 (so that the velocity is rising for the specified amount of time)
Reply With Quote
  #4  
Old 06-01-2018, 04:38 AM
Lenticularis Lenticularis is offline
Member
 
Join Date: Jul 2016
Posts: 12
Moving an object.
Vizact.move(0,0,velocity,time) --> I can indicate a velocity and a duration of the movement. How to implement accelerated movement?
Reply With Quote
  #5  
Old 06-01-2018, 03:46 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could apply a force using physics or register a function with vizact.onupdate where the object's position is set each frame.
Reply With Quote
  #6  
Old 06-07-2018, 10:57 AM
Lenticularis Lenticularis is offline
Member
 
Join Date: Jul 2016
Posts: 12
I tried the following code. Do you see mistakes?

Code:
def Movement():
	
	Object.setPosition(0,0,0)
	
	v0 = 0
	t = 0
	a = 1
	
	while t < time:
	
		s = v0*t + 0.5*a*t**2
		vizact.ontimer2(0.1,0,Object.setPosition,0,0,s)
		t = t+0.1
I was not really expecting it to work since it was only a "quick and dirty" solution. But I actually don't see where the problem is.
Reply With Quote
  #7  
Old 06-08-2018, 06:00 AM
Lenticularis Lenticularis is offline
Member
 
Join Date: Jul 2016
Posts: 12
Never mind. Managed to do it with an even simpler solution. It is not entirely precise, but it works quite well. It isn't even shaking. Here is the code I used:

Code:
def Movement():

	Object.setPosition(0,0,0)

	v0 = 0
	t = 0
	a = 5

	while t < time:
	
		s = v0*t + 0.5*a*t**2
		Object.setPosition(0,0,s)
		t = t+0.0168	#Adjustement based on processing speed of computer (lazy amateur workaround)
Reply With Quote
Reply

Tags
acceleration, motion, movement, velocity, vizact

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
Mismatched Translation Between Real Motion and Display amir Vizard 2 05-31-2018 07:17 AM
Motion Builder Without Live Characters? lafortuj Precision Position Tracker (PPT) 2 07-30-2015 05:21 PM
PPT Mocap and Motion Builder Connection Problem hxphan Precision Position Tracker (PPT) 3 02-22-2011 11:01 AM
an object in motion does not stay in motion? driechers Vizard 2 11-09-2010 03:51 PM
Motion Capture & CyberGloves EnvisMJ Vizard 1 10-01-2009 04:21 PM


All times are GMT -7. The time now is 04:42 AM.


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