realbasic-games
[Top] [All Lists]

Re: UV settings

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: UV settings
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Sat, 22 Oct 2005 11:39:52 -0600
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <9abc90404cec20e07a6dc74205677e14 at pyramiddesign dot us>
At 9:52 AM -0400 10/22/05, Joseph Nastasi wrote:

  // add texture and indicate using UV
  t.Material.Texture =   texture
  t.HasVertexUVs = True

I see the digit area, but assumed that I should see "0" since that is the first of the texture image.

I wouldn't assume you'd see anything at this point, since you haven't set the UV coordinates yet.

In my update method:

  Trimesh.VertexUVs.SetUV(0,0,digitvalue * offset)

where digit value is 0 through 9 and offset is the height of each digit section in the texture image.
I see some change in color, but nothing recognizable.

You're only setting the UV coordinate for the first vertex (index 0). You need to set it for all four vertices to get anything sensible out.

Questions:
1. in the world of UVList, where is 0,0 located (top left or bottom left)?

Top left.

2. Given a two triangle trimesh and one material added, am I correct in assuming that there is only one entry in the UVList?

Nope.  Your mesh has four vertices, so there are four UV coordinates to set.

Best,
- Joe

--
Joe Strout                          REAL Software, Inc.

Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>