View Single Post
  #1  
Old 01-19-2017, 04:33 AM
Patrick Patrick is offline
Member
 
Join Date: Oct 2016
Posts: 13
Cooperation of things within the Virtual world

Hello,

So i wrote a Program where i implemented a STL-Data (Basicly a Matlab created cuboid that should simulate a heating system).
Recently i started to use physics in my Program.

Code:
viz.setMultiSample(4)
vizconnect.go('vizconnect_hand_vive.py') 
viz.phys.enable() 
viz.collision(viz.ON)

ground = viz.addChild('ground_gray.osgb')
ground.collideplane()
Heizung = viz.addChild('heiz2.osgb')
Heizung.collideBox()
I set the ground as bottom and enabled the Heizung for physics via the CollideBox command.
The problem that i have now is that the cuboid (who is higher than he is wide) just drops over to the front. What i want it to do tho is to fix that cuboid at the bottom so it basicly simulates an imobile machine. So the question is can i attach that Child to the ground level and make it kinda "heavy" as if a massive metal block would stand there.

And on top of that i wanted to figure out a way to attach smaller boxes to it. Basicly if i take a generated box and put it at a certain point of the Big block it gets attached to that point.

Code:
box1 = vizshape.addCube(size=0.2, pos=[0,1.45,5.4],alpha=1)
box1.collideBox()
So if i take that Box and put it at a certain point (that i defined before) somewhere on the side of my "Heizung" it gets attached to that automatically and stays at that point? But if i grab it again i want to be able to remove it again aswell.

Thanks in Advance
Reply With Quote