#1
|
|||
|
|||
Linking Objects
Hi All,
A while ago, I had a problem with headlights, whereby when I attached them to a car, I had a jagged light effect as the vehicle approached - because it was highlighting each road texture quad in turn. I have decided that the way to get over this would be to simply link a small quad that is fixed to the vehicle (offset by say 20 cm) in front, that the lights could illuminate as it moved towards the viewer. However, I am having difficulties getting the quad to link, as the euler command is not rotating it (see code) below. If anyone knows a way that I can program it to get the road quad to lay flat, that would be great. Thanks Mark Code:
road = viz.addTexture('Roadstrip3.png') roadstrip = viz.addTexQuad(viz.WORLD,viz.MainScene,1) roadstrip.texture(road) roadstrip.setScale(roadscale[0],roadscale[1],1) roadstrip.setPosition(0,1,1) roadstrip.setEuler(90,90,0) # vehicle 1 a Car ### TOYOTA car1 = viz.addTexture('car2.gif') vehicle0 = viz.addTexQuad(viz.WORLD,viz.MainScene,1) vehicle0.texture(car1) vehicle0.setScale(carsize[0],carsize[1],1) vehicle0.setEuler(90,0,0) vehicle0.setPosition(outofview) vehicles[0] = vehicle0 viz.link(vehicle0, roadstrip, priority=1, offset = (0, -1.2, -0.1)) |
#2
|
|||
|
|||
When it comes to linking objects in vizard, you have to use the commands link.preEuler([yaw,pitch,roll]) and link.preTrans([x,y,z]) functions after creating the link instead of vehicle0.setEuler and vehicle0.setPosition before creating the link. So try this:
Code:
link = viz.link(vehicle0, roadstrip, priority=1, offset = (0, -1.2, -0.1)) link.preEuler([90,0,0]) link.preTrans(outofview) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"reverting" between animations & linking objects to bones | Lithium | Vizard | 3 | 08-08-2011 11:01 AM |
Trouble picking text3d objects | Salvar | Vizard | 4 | 12-01-2010 03:07 PM |
Semi-circle array containing target and distractor objects | ptjt255 | Vizard | 3 | 08-04-2009 03:09 AM |
Lightwave objects rotation problem | hosier | Vizard | 6 | 02-13-2009 12:04 PM |
Could not find plugin to load objects... | halley | Vizard | 1 | 05-30-2006 11:01 AM |