WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1  
Old 05-09-2013, 10:08 AM
mshukun mshukun is offline
Member
 
Join Date: Jan 2013
Posts: 32
Texture Coordinates in a Cube Map

I am trying to ascertain texture coordinates for each created vertex in a cube map (i.e. a 360 degree panorama). I have tested "getTexCoord" in the cube map, resulting in all vertices' texture coordinates to be [0.0, 0.0, 0.0]. I thought texture coordinates of the vertex [0,0,0] to be [0.5,0.5, ?] (I don't know 'r' in this case). Is the "getTexCoor" function not meant for cube maps as well? If so, is there way to get texture coordinates or array index number for each vertex of cube face?

I truly appreciate any help that you might be able to provide. Thanks so much in advance.

Code:
import viz

viz.go()

env = viz.addEnvironmentMap('gpo_L.jpg')
sky = viz.addCustomNode('skydome.dlc')
sky.texture(env)

viz.startLayer(viz.POINTS)
viz.vertexColor(viz.GREEN)
viz.pointSize(15)

viz.vertex(0,0,0)
viz.vertex(-4.2, -16.5, 98.2)
viz.vertex(-13.8, 3.6, 99.0)
points = viz.endLayer()

print points.getTexCoord(0)
print points.getTexCoord(1)
print points.getTexCoord(2)

import vizcam
vizcam.PanoramaNavigate()
Reply With Quote
  #2  
Old 05-09-2013, 04:00 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you explain what you are trying to accomplish? The getTexCoord() function will return the texture coordinates you assigned to the vertex. Your code is not specifying any texture coordinates, so getTexCoord() will return [0,0,0].

Texture coordinates for cube maps are generally specified as a 3 component normalized direction vector from the center of the cube.
Reply With Quote
  #3  
Old 05-10-2013, 12:31 PM
mshukun mshukun is offline
Member
 
Join Date: Jan 2013
Posts: 32
Thank you very much for your reply. I would like to draw all vertices onto each cube face image and then save them as new image files (in order to record and display where a user throws a ball in a 360 degree interactive environment). By analogy, in Google maps one can create place marks and store it as an image file. In my case, I am trying to perform the same essential function in a cube map (since place marks are added using HMD, users freely look around and add place marks onto 360 panorama images). All place marks x, y and z coordinates are then stored in database to populate all place marks and save them as a new image file for each face for later analysis -- at least that is my goal of what I would like to accomplish.

I would like to apply 2D texture coordinates (s and t) instead of 3D so I was thinking bottom left [0,0], bottom right [1,0], top left [0,1] and top right [1,1] for each face image should serve my needs, and I thought this would be the default texture coordinate system for a cube map, but it appears I was incorrect. Therefore, how do I set 2D texture coordinates for a cube map? I suspect the answer will require considering axis direction (e.g. Positive X : -Z(s), -Y(t), Positive Z: +X(s), -Y(t) and so on).

I believe finding the texture coordinate is the best method to achieve my purpose, but if you have any suggestion or guidance, it would be greatly appreciated.

Thank you again.
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
360 panorama image cube using as darts target and record the xy coordinates mshukun Vizard 2 03-14-2013 06:17 AM
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
Haptic touch texture coordinates yth Vizard 0 06-02-2012 03:40 AM
Avatar texture swaping sleiN13 Vizard 5 06-24-2011 12:48 AM
How to apply shader and render texture to an object whj Vizard 0 04-23-2010 12:23 PM


All times are GMT -7. The time now is 12:25 PM.


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