Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8193449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:29:04+00:00 2026-06-07T04:29:04+00:00

i Wonder How to put texture on my boxes in my Vpython script?

  • 0

i Wonder How to put texture on my boxes in my Vpython script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:29:05+00:00Added an answer on June 7, 2026 at 4:29 am
    from visual import *
    
    box(pos=(-1,-1,-2), length=2, height=2, width=4, material=materials.wood)
    

    enter image description here

    For more details, see http://vpython.org/contents/docs/visual/materials.html

    Edit: at the link above, look for the section titled “Making a texture from a photo”

    Edit2: not sure what’s causing your error; this works for me:

    from visual import *
    import Image
    
    im = Image.open('flower.jpg')  # size must be power of 2, ie 128 x 128
    tex = materials.texture(data=im, mapping='rectangular')
    
    box(material=tex)
    

    enter image description here

    Edit3: I figured out what caused your error:

    box(material=materials.loadTGA(filename))
    

    fails;

    tex = materials.texture(data=loadTGA(filename), mapping='rectangular')
    box(material=tex)
    

    works properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder whether someone can help me please. I've put together the script below
I wonder whether someone can help please. I'm trying to put together a script
I wonder where to put data files (for example XML) to be loaded internally
I wonder if I can put mc:Ignorable=d d:DesignWidth=640 d:DesignHeight=480 in StaticResource , is that
I wonder whether someone may be able to help me please. I've put together
This is a practical question, i wonder if its possible to put a mark
I wonder how I can put a unit of Google AdSense under the article
I wonder whether someone can help me please. I've put together this page, which
I wonder whether someone can help me please. I'm trying to put together a
I wonder where to put the optimization and debugging options in Makefile: linking stage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.