PDA

View Full Version : Multiple views with robot: collision & scaling problems


tokola
01-13-2013, 11:22 AM
Hi there.

I am building a collaborative game where I have 3 views in 3 separate windows and I am using Steve (the robot) as a representation of the each player on the other 2 views (besides its own). It's pretty much like the networking.py example of Vizard, only running on one machine. The issues I am having are caused by the fact that the robot collides with the viewpoint, although it is not being rendered in its view's window (_avatar.renderToAllWindowsExcept([avatarWindow]). I have disable INTERSECTION on the robot object, but collision is still on. In the attached image you can see how it looks like, with the robot appearing too high because it is moved upwards after the viewpoint collision.

Also, I would like to have the viewpoint at the robot's eyeheight instead of neck height which is currently the center of the object. I changed the center in Steve's class using the setCenter command but it didn't work. But even if it worked the collision issue would prevent it to be there. Scaling of the robot is also problematic; setting a scaling factor messes with the tracker data (I am using the setTracker command).

Basically, I am facing these 3 problems:
- How can I have the robots (viewpoints) collide normally between each other, without having the robot collide with its own viewpoint?
- How can I scale (enlarge) the robot without affecting tracking?
- How can I align the viewpoint with the robots eyeheight?

I hope these are doable because they are pivotal for my work.
Thanks for your help.

tokola
01-16-2013, 10:24 AM
Any help on these please!?!?
I still have those problems and need to find a solution/workaround soon.
Thanks,
tokola

farshizzo
01-18-2013, 06:03 PM
To scale the robot, but not the movement, you can apply the scale to the head/body parts: For example, to double the size try the following code:
robot.head.setScale([2,2,2])
robot.body_root.setScale([2,2,2])

You can apply an offset to the tracker, to center with the eye height:
robot.setTracker(viz.link(tracker,viz.NullLinkable ,offset=[0,-0.2,0]))

tokola
01-19-2013, 12:13 PM
Farshizzo,
thanks for your reply however I had 33% success! The scale worked fine but I still have the other two problems:
1) You didn't respond on how to deactivate collision of the robot with the viewpoint on each window. Although the robot is not rendered in its own window, it still collides with the viewpoint. Why? Eventually, the view is pushed to ~2.32m instead of the default 1.82m, just between body and head, due to this collision.
2) You need to be a little more detailed about your second response because I am still an amateur Vizard user! What's the tracker gonna be in this case? I am using the setTracker to manipulate the robot as mentioned in the examples, updating the matrix on every frame:
robot.setTracker(view._player_matrix)
Inserting a second call to this method just ignores the first one and the robot is not following the viewpoint. I've tried these two option separately:
robot.setTracker(viz.link(robot.body, viz.NullLinkable,offset=[0,-0.2,0]))
robot.setTracker(viz.link(robot.head, viz.NullLinkable,offset=[0,-0.2,0]))
What else can act as a tracker in your provided solution? And of course, when this is implemented correctly the viewpoint will collide with the robot's head (going back to problem 1)!

Excuse my -probably- naive question but I am trying to understand and learn.
Thanks,
tokola

tokola
01-28-2013, 09:59 AM
Farshizzo,
could you please share your knowledge on the issues mentioned above, and clarify things? I still couldn't overcome the collision and view offset problems, and it's rather imperative to make these robots behave as described.

Thanks a lot,
--Panagiotis