WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-30-2014, 08:27 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
vizact move action

Hi,
I have a problem with using the move action in Vizard 4&5. the simple use case is i am navigating with the MainView through actions. I have viz.MainView.collision( viz.ON ) so that i don't go through walls, and in case of collision i cancel the current action and clear the action list. but i still move backwards (sometimes), away from the collision point. i looked a lot in the documentation and a bit in the vizact source code and i don't find a way to prevent this. on the contrary, i found a confirmation of the behavior in the VizMoveAction class.
how can i solve this? i want to keep things simple and not necessarily realistic, that's why i'm avoiding physics.
Best,
Andrei
Reply With Quote
  #2  
Old 10-30-2014, 09:26 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
no that i think of it, the problem is maybe less related to vizact and more to the model i'm using. i mentioned vizact because there i can see more clearily what's happening and it's where i spend my last hopes of solving the problem by myself. but i get the same behavior while navigating with the mouse. the model i have is a valid collada model and the normals are ok. i don't have the bounce back effect if the collision surface is aligned along the x/z axes, which i find really strange...
Reply With Quote
  #3  
Old 10-31-2014, 06:41 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
me again.
i stripped down my code to the very basic and still didn't find a solution. i can't see how anything could be wrong in the usage, but i posted the code below anyway. i also tried different models from 3D Warehouse and i could reproduce the problem.
attached is a very simple collada model i generate myself(rename to .dae). the normals are ok, but i still have the bumping effect when the wall is oblique. i think the problem is somewhere in the Vizard navigation code and has something to do with vector decomposition, otherwise i cannot explain why it's not happening when the wall is parallel with an axis...

Code:
import viz

viz.setOption('viz.model.apply_collada_scale',1)

world = viz.addChild('.\\..\\configs\maze3D.dae')
world.collideMesh()

env = viz.addEnvironmentMap('sky.jpg')
sky = viz.addCustomNode('skydome.dlc')
sky.texture(env)

viz.disable(viz.LIGHTING)

viz.MainView.collision(viz.ON)

viz.MainView.setPosition(3.02036, 0.00000, -0.08363)
viz.MainView.eyeheight(0.11)

viz.go()
Attached Files
File Type: txt maze3D.txt (11.5 KB, 4294 views)
Reply With Quote
  #4  
Old 11-04-2014, 03:09 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
Hi there,
i've been trying to different geometries, i've tried to use physics, nothing seems to work. can anyone tell me what am i doing wrong? is this bounce made by design? isn't there any way to avoid it?
i can split the move commands in smaller ones and manage to hide a bit the behavior, but still doesn't solve the problem.
any ideas? suggestions?
Reply With Quote
  #5  
Old 11-04-2014, 05:47 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
I ran your example code with model and notice the viewpoint bounces when colliding with the edge of a wall. Is that what you are describing or does it occur at other times as well?
Reply With Quote
  #6  
Old 11-04-2014, 05:54 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Does changing the collision buffer affect the bounce you see?
Reply With Quote
  #7  
Old 11-05-2014, 03:02 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
hi Jeff,
a few details about the test/problem - i am getting towards the wall until collision. then i try to advance oblique against the wall. what i expect is to slide along. instead i slide and bounce at the same time. it happens on the whole length of the wall, as long as the wall is not parallel with one of the axis.
i already did try to change the collision buffer, but with no success. did it work for you? with what value?
Reply With Quote
  #8  
Old 11-07-2014, 09:36 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
since the problem is still not solved i thought to come with my latests feedback. i have an even simpler script to reproduce it:
Code:
import viz

viz.MainView.collision(viz.ON)
viz.MainView.collisionBuffer(1)

world = viz.add('lab.osgb')

#commenting this line makes the bouncing effect dissapear
world.setEuler(30, 0, 0)

viz.go()
i think that it's a bug and it has to do with using the wrong (global) coordinates when calculating the collision. that's why it works when the the walls are parallel with the axes. but this is code i cannot see and i wouldn't be able to change it anyway.

or maybe i'm wrong...

any other ideas?

thank you,
andrei
Reply With Quote
  #9  
Old 11-07-2014, 03:49 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Thanks for the simple example. I'll check with a developer about this.
Reply With Quote
  #10  
Old 11-12-2014, 06:39 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
thank you for support. looking forward for the solution.
don't hesitate to contact me in case you need more details.
Reply With Quote
  #11  
Old 11-14-2014, 11:34 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Sorry, I don't have a solution to provide here. This is a limitation of viewpoint collision.
Reply With Quote
  #12  
Old 11-14-2014, 11:58 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
so what would you suggest?
Reply With Quote
  #13  
Old 11-14-2014, 01:04 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
If the walls are only slightly off parallel from the XZ axes the following may be an option. Use two models, one for the visible geometry and another that's not rendered and used for collision detection. The collision model surfaces would need to be parallel to the XZ surfaces and there would be a displacement between the visible and collision meshes.
Reply With Quote
  #14  
Old 11-19-2014, 02:54 AM
andreionutz andreionutz is offline
Member
 
Join Date: Apr 2012
Posts: 15
i have no restrictions for the geometries, and actually very little knowledge about the model as a whole. the user can generate 3d content and use it, and therefore the walls can be anything.
Reply With Quote
Reply

Tags
collision, 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
Using move() and spinTo efficiently Shweta Vizard 3 07-29-2014 05:10 PM
Hand Grab and Object Action rmcconnell11 Vizard 2 04-30-2014 06:51 AM
how to move seperately? nasr Vizard 2 05-11-2009 01:57 AM
move animated camera around corner question nlfrnassimi Vizard 1 02-23-2009 09:45 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM


All times are GMT -7. The time now is 05:28 AM.


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