Hi, and thanks for your attention.
I really can’t figure out why my collision triangle is misplaced.
I am trying to place it with one vertex at the same coordinates as the model (a building) - but it appears outside the building; at a distance that I think is proportional to the buildings distance to (0,0,0).
I am even assigning a variable (named position) to the position to be sure to keep track of it.
The funny thing is that if I # the loadModel then the Triangle is placed where I want it to.
Here is the code:
base.disableMouse()
base.camera.setPos(20,-10,60)
base.camera.setHpr(20,-45,0)
self.building = loader.loadModelCopy(“models/BuildingCluster3/BuildingCluster3”)
self.building.reparentTo(render)
self.building.setScale(.5,.5,.05)
position=Point3(0,40,0)
self.building.setPos(position)
southernTriangle=CollisionPolygon(position , position+Vec3(0,0,10) , position+Vec3(10,0,0))
southCollNode=CollisionNode(“southColl”)
southCollNode.addSolid(southernTriangle)
southColl=self.building.attachNewNode(southCollNode)
southColl.show() #TBD when done
The model is from alice.org/pandagallery/City/BuildingCluster3.zip