WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How to apply texture on an on-the-fly 3d object (https://forum.worldviz.com/showthread.php?t=4847)

Zhi 10-10-2013 01:51 PM

How to apply texture on an on-the-fly 3d object
 
This question may be naive. But I could not find the answer in the forum or from the vizard help file.

I used vizshape.addCylinder() to create an on-the-fly cylinder. Then, I used <3d_node>.texture to add a texture on it. But, the texture does not appear on the top and the bottom circular faces of the cylinder. What shall I do? :confused:

Here is my code:
Code:

        tex = viz.addTexture('wood.jpg')
        tex.wrap(viz.WRAP_R,viz.REPEAT)
        tex.wrap(viz.WRAP_T,viz.REPEAT)
        tex.wrap(viz.WRAP_S,viz.REPEAT)

        circle = vizshape.addCylinder(height=0.15, radius=0.5)
        circle.texture(tex)


Zhi 10-11-2013 10:40 AM

I think the problem is probably related to the texture wrapping. Because I can see texture on the side surface of the cylinder, but there is no texture on the top and bottom surfaces of the cylinder. However, the color of the top and bottom surfaces changed to the closest color to that of the texture I applied.

Notch 09-01-2014 01:15 PM

Did you ever find a solution to this? I'm trying to color an on-the-fly cylinder but am unable to get the color to appear on the top and bottom of the cylinder.

Notch 09-09-2014 04:42 AM

I think this might have been a lighting issue; without a specific light source, Vizard can make objects appear very dark in some situations. It's possible that the object was coloured, but I couldn't see the colour.


All times are GMT -7. The time now is 07:05 PM.

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