WorldViz User Forum graduation project need help
 Register FAQ Search Today's Posts Mark Forums Read

#1
05-15-2009, 05:12 AM
 minawageh Member Join Date: Mar 2009 Posts: 6

in my project i wanna assemble a pump manually so
i wanna use snaping tool to help in assembling it as if you pick an object and get close enough to onther object and with suitable position and rotation it will be oriented so i can slide it along onther part axis (mainly x-axis) so i wanna calculate to differance between there position taking in considration orientation differance
so if it can be done any way i wanna know very soon
and i was trying use matrix to calculate it but till now i can't so i need help as soon as possiable
THX
MinA
#2
05-15-2009, 11:44 AM
 Gladsomebeast Member Join Date: Mar 2005 Location: Isla Vizta, CA Posts: 397
The vizmat module has the functions you need:

Code:
if vizmat.AngleBetweenVector(partForwardVector, fittingForwardVector) < 5
and
if vizmat.Distance(partPos, fittingPos) < .1:
snappySnap()
__________________
Paul Elliott
WorldViz LLC
#3
06-08-2009, 04:21 AM
 minawageh Member Join Date: Mar 2009 Posts: 6

Quote:
 Originally Posted by Gladsomebeast The vizmat module has the functions you need: Code: if vizmat.AngleBetweenVector(partForwardVector, fittingForwardVector) < 5 and if vizmat.Distance(partPos, fittingPos) < .1: snappySnap()
thx very much for help but i can't understand this command could u plz explane what are the parameters and how can i atach the vectors to my objects
and i have onther problem with collision i have a complex shaps so i tried to use collidMesh but it didn't work as if i pick object it collide with others could you explane hoe to use it and if there any way to make collide shape for hollow cylinder
thx again
#4
06-08-2009, 12:02 PM
 Gladsomebeast Member Join Date: Mar 2005 Location: Isla Vizta, CA Posts: 397
You can get the forward vectors of the parts and fittings from their transform matrices.
Code:
partForwardVector = part.getMatrix().getForward()
The physics system does not support dynamic forces, like gravity, on collideMesh shapes. Complex shapes need to be made up of multiple simple shapes like boxes and spheres.

What you'll want to do is name some sub-nodes of your hollow cylinder and call collideBox(node="subobject1") on them. The docs have an example on this with the table.wrl object:

Code:
table.collideBox(node='Leg1') # Define
table.collideBox(node='Leg2') # collision
table.collideBox(node='Leg3') # area
table.collideBox(node='Leg4') # for
table.collideBox(node='Top')  # parts
__________________
Paul Elliott
WorldViz LLC
#5
06-30-2009, 03:11 AM
 minawageh Member Join Date: Mar 2009 Posts: 6
Quote:
 Originally Posted by Gladsomebeast You can get the forward vectors of the parts and fittings from their transform matrices. Code: partForwardVector = part.getMatrix().getForward() The physics system does not support dynamic forces, like gravity, on collideMesh shapes. Complex shapes need to be made up of multiple simple shapes like boxes and spheres. What you'll want to do is name some sub-nodes of your hollow cylinder and call collideBox(node="subobject1") on them. The docs have an example on this with the table.wrl object: Code: table = viz.add('table.wrl',pos=[0,3,6.5],euler=[90,45,90]) # Add table table.collideBox(node='Leg1') # Define table.collideBox(node='Leg2') # collision table.collideBox(node='Leg3') # area table.collideBox(node='Leg4') # for table.collideBox(node='Top') # parts

thx very much for your help but i don't know how to make sub-nodes and i don't know if i can do it in vizard or i must make it in athor programes like 3d max
and i don't know what to do with
partForwardVector = part.getMatrix().getForward()
and how to use it

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Getting Vizard Help with AI Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post mberkes Vizard 14 05-27-2009 11:54 AM minawageh Vizard 5 03-17-2009 03:17 PM pattie Vizard 2 02-06-2007 08:09 AM

All times are GMT -7. The time now is 06:24 PM.