WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-09-2015, 02:19 PM
MissingAFew MissingAFew is offline
Member
 
Join Date: Apr 2015
Posts: 15
Offset position of link/attached object

How do you change the relative offset of an attached object when using viz.link? Is this possible? setPosition doesn't work and there doesn't seem to be a set relative position function. Also need the rotation as well.
Reply With Quote
  #2  
Old 04-09-2015, 06:18 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
You can apply a postTrans or preTrans operation on the link.
Reply With Quote
  #3  
Old 04-11-2015, 01:12 PM
MissingAFew MissingAFew is offline
Member
 
Join Date: Apr 2015
Posts: 15
Quote:
Originally Posted by Jeff View Post
You can apply a postTrans or preTrans operation on the link.
Thanks, I already figured out what I needed to. However I am having a few issues implementing a FPS style control scheme where the change in mouse position rotates the player. Here's pastebin of relevant code:

http://pastebin.com/GDFTYf2d

This code is contained within my function UpdateView and gets updated with the following:

vizact.ontimer(0,UpdateView)

Now this code works, however, it is very jittery. It is not smooth at all. And if I only move the mouse a little bit, it wont cause the player to rotate. The way Im doing this feels very "hacky", but I'm not sure how else to do it. I haven't any example code for this kind of control scheme. Is there a better way to accomplish this? To me it seems like the UpdateView function is not being called every frame which is the cause of the jitteryness, but I am not entirely sure.
Reply With Quote
  #4  
Old 04-13-2015, 05:15 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
One of the built-in cameras from the vizcam library may set up the navigation style you would like:

Code:
import viz
viz.go()

import vizcam
vizcam.FlyNavigate(forward='w',backward='s',left='a',right='d')
#vizcam.WalkNavigate()

viz.addChild('piazza.osgb')
Reply With Quote
Reply

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
Problem with object position Ryvan Vizard 2 01-22-2015 01:01 PM
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
Can you link the position of a tracker to the orientation of an object? michaelrepucci Vizard 1 09-19-2008 10:23 AM


All times are GMT -7. The time now is 03:36 AM.


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