Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Change Lightmap from Javascript

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
I need to change the lightmap of an object from javascript by specifying the new lightmaps file name. I found a post which had a link to an example but the page could not be displayed.
 
Posts: 48 | Registered: April 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Shawn,

Could you point me to the post and maybe I can figure out where the example is on our servers.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Here is a link to the old post...

Old Post
 
Posts: 48 | Registered: April 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Shawn, you would do this in much the same way as you are trying to do in the other post with diffuse texture:

function myFunc(){
vmp.SetProperty('MTSTimeElem.myLoaderElem','Path','mylightmap.jpg','mts_str');
vmp.SetProperty('MTSScene','nerd',1,'mts_int');
}

Whenever you do something to swap textures in the scene from javascript, it is sometimes necessary to re-render the scene to see the change. Just a note on what the last line is for.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
I am trying to get this working but it is not updating the light map here is my code


<MTSInstance Name="truck_bottom" >
<Transform>
<Scale x="0.0024" y="0.0024" z="0.0019" />
<Rotate x="0" y="0" z="90" />
<Position x="0.0276" y="-0.0943" z="0.0117" />
</Transform>
<MTSGeometry Name="truck_bottom_GEOM" BackFaceDir="-1" />
<MTSMaterial Name="truck_material" ID="0">
<MTSTextureMap Type="Light" Name="truck_texture"/>
</MTSMaterial>
</MTSInstance>



<MTSTimeElem Type="MTSImageStream" Path="resources/lightmaps/chrome05.jpg" Name="truck_texture_control" Comp="0">
<Target Name="MTSTexture.truck_texture" />
</MTSTimeElem>
 
Posts: 48 | Registered: April 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Shawn,

This is working. See if it helps you out.

Zip/GZ archivelightmap_change.zip (74 KB, 10 downloads)
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Change Lightmap from Javascript