WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Infinite Terrain OK but Interior Car Disappearing (https://forum.worldviz.com/showthread.php?t=6151)

hannahapz 06-06-2018 08:12 AM

Infinite Terrain OK but Interior Car Disappearing
 
New to Vizard.

Trying to upload infinite terrain but my car disappears. Solution?
Code:

# Add ground
ground = viz.add('images/road.jpg', wrap = viz.REPEAT)
terrain = viz.add('InfiniteTerrain.dlc', 1, '0', 0, 30, 15000, 0.0005)
terrain.texture(ground)

# Add mini-coop
car = viz.addChild('mini.osg')

#Keyboard interaction for car
def updatecar():
        if viz.key.isDown(viz.KEY_UP):
                view.move([0,0,MOVE_SPEED*viz.elapsed()],viz.BODY_ORI)
        if viz.key.isDown(viz.KEY_DOWN):
                view.move([0,0,-MOVE_SPEED*viz.elapsed()],viz.BODY_ORI)
        if viz.key.isDown(viz.KEY_RIGHT):
view.setEuler([TURN_SPEED*viz.elapsed(),0,0],viz.BODY_ORI,viz.REL_PARENT) # last argument = apply rotation relative to existing rotation
        if viz.key.isDown(viz.KEY_LEFT):        view.setEuler([-TURN_SPEED*viz.elapsed(),0,0],viz.BODY_ORI,viz.REL_PARENT)
               
        # now attach car to the viewpoints BODY_ORI
        car.setPosition(view.getPosition())
        car.setEuler(view.getEuler(viz.BODY_ORI))
        car.setPosition([0.35,-1.20,0.2],viz.REL_LOCAL)

# Create perpetual timer and register function to call when this timer expires
vizact.ontimer(0, updatecar)


hannahapz 07-25-2018 06:30 AM

Fixed with viz.clip()


All times are GMT -7. The time now is 08:34 AM.

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