WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-20-2012, 05:32 AM
new_horizon new_horizon is offline
Member
 
Join Date: Apr 2010
Posts: 43
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))
Reply With Quote
  #2  
Old 04-20-2012, 06:07 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC