PDA

View Full Version : Three questions


pea
04-29-2012, 03:24 AM
Hello,

I would like to know if there is the possibility to configure some options that I have not found in the documentation:

1. I know about the option, that I can adjust the specular property of individual objects but not on lights. Is there a way to enable/disable "specular casting" from a light? I want to create several lights, some that cause highlights on the objects and some just as "filllights" that do not evoke highlights.

2. Is there the possibility to have three objects with physics enabled, lets say a sphere, cube and floor and make the cube collide with the sphere and not with the floor but the sphere collide with both the cube and the floor?
I basically want to tell objects to collide only with certain objects and not with all. I can imagine, that one would have to make use of the contact groups which I found to be implemented in OPAL: http://opal.sourceforge.net/tutorial8.html
Is this difficult to access?

3. My last question is quite similar and deals with the collideMesh option. It is not possible to use forces with that. Why is this the case?
It seems that OPAL has such an option: http://opal.sourceforge.net/tutorial10.html
Would it be very complicated to implement such an option in general?


I was searching for clear answers to these questions in the forum and in the documentation for a while now but I never found any clear statements to that, so I would be really happy to learn about the possibilities that I have probably missed so far.

Best,
Petra

pea
05-19-2012, 02:52 AM
Does really nobody have an answer to at least one of my questions?

farshizzo
05-22-2012, 09:23 AM
1) Setting the specular color on the light to black should effectively disable specular casting:light.specular(viz.BLACK)

2) Contact groups are supported but not documented yet. Here is an example on how to use them:import viz
import vizshape
viz.go()

#Enable physics
viz.phys.enable()

#Create floor
floor = viz.add('ground.osgb')
floor.collidePlane()
floor.commandPhysics(26,'',1) #Set contact group to 1

#Create sphere
sphere = vizshape.addSphere(pos=(0,2,10))
sphere.collideSphere()

#Create cube
cube = vizshape.addCube(pos=(0.1,5,10))
cube.collideBox();
cube.commandPhysics(26,'',2) #Set contact group to 2

#Disable contacts between groups 1 and 2
viz.phys.command(3,'',1,2,0)


3) Dynamics on mesh shapes is not supported in the version of ODE/Opal used by Vizard. Are you positive it is supported by OPAL? The link you posted just describes how to create mesh shapes, it does not mention enabling dynamics on the mesh.

pea
06-12-2012, 05:15 AM
Thanks a lot for your response!! This was exactly what I wanted to know.
Considering 3), I must have misunderstood the contents of the link, thanks for making that clear to me.