WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-16-2014, 07:48 AM
johnallen johnallen is offline
Member
 
Join Date: Nov 2013
Location: Canterbury, UK
Posts: 36
load jpg/bmp image file into wirtual world

Hi,

I want to load a jpg image file into my virtual world and display it on the wall (like a picture in a gallery) of my room (which is already loaded as an osgb file)

I thought this would be simple to do but couldn't find an example. In the end I came up with this which sort of works but I was wondering whether there is a better way to do it?

In particular, a way to link the jpg to the wall rather than having to tweak the position coordinates until its close enough that it looks right (rather than using the magic numbers as I've done so that it works for my room)

Code:
    room = viz.add( 'room.osgb')
    pic1 = viz.addTexture('mona.jpg')

    quad = viz.addTexQuad(parent=room)
    quad.setPosition([ 0,1.6,2.05 ])
    quad.texture(pic1)
Thanks,

John
Reply With Quote
  #2  
Old 12-16-2014, 05:57 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,467
You'll probably want to apply the texture to a sub-part of the model rather than the model as a whole. In the following code a new texture is applied to one of the gallery paintings:

Code:
import viz
viz.go()

gallery = viz.addChild('gallery.osgb')
texture = viz.addTexture('lake3.jpg')
gallery.texture(texture,node='painting_starry-night')
Reply With Quote
Reply

Tags
image jpg bmp

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
how to start video texture on world load in cave mode raj Vizard 3 02-27-2014 05:55 PM
ERROR: Failed to load .ive file turgutm Vizard 1 09-16-2010 06:16 AM
Failed to load wav file BrynJ Vizard 1 04-24-2008 10:35 AM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM
File Path 4 Object Load softscan2 Vizard 1 09-23-2005 09:59 AM


All times are GMT -7. The time now is 09:16 AM.


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