realbasic-games
[Top] [All Lists]

Re: Sharing textures

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Sharing textures
From: Jeff Quan <jquan at mindspring dot com>
Date: Sat, 25 Jun 2005 11:03:31 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=mindspring.com; b=GJR8c58s52DNYdc6vqlQDnpqMasErL6ltxGERneglDzZTkDD+AkvcBjrSNvgM4FY; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer:X-ELNK-Trace:X-Originating-IP;
References: <485bea6f7e4536c11d2387c99f86ffbf at optonline dot net>

On Jun 25, 2005, at 10:36 AM, Daniel Lurie wrote:
Is there a way to make multiple object 3Ds share the same texture?

At the moment, not without declares. You can use Frank's Quesa Wrappers.

Here's a snippet of code that should work using Quesa Wrappers. This assumes that the obj has a pre-existing texture to be replaced and will ONLY affect the first trimesh's texture. This means, in Meshwork terms, if you've applied multiple materials only the first one will be affected. You'll need to do a bit more legwork to get to the other textures.

Sub UpdateObjTexture(obj As Object3D, texture As Picture)
  Dim tmsh as Trimesh3D
  Dim mat as AttributeSet3D
  Dim tex as TextureShader3D

    // Get existing texture on obj.
    // NOTE: This only affects first trimesh only!
    tmsh = obj.GetFirstTrimeshInShape(i)
    mat = tmsh.GetMaterial
    tex = mat.GetTextureShader

    // Replace texture
    tex.SetTexture texture, tex.kPixelTypeRGB32

==
Jeff Quan
jquan at mindspring dot com

_______________________________________________
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>