Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    mesh at runtime

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
rik
Member
Posted
hi,

I'm working to create mesh at runtime with javascript.

if I put the mesh mtx description inside the scene loaded with:
vmp = new MTSPlugin( 'default_scene.mtx' .....
the mesh will create

but if I use vmp.execute( ...the mesh quoted string... ) the mesh will create into the scene but the refresh not work.

I use vmp.Render() after execute(...) method, but the refresh work only for all other instances and not for the mesh.


this is the mtx code

<MTSInstance Name="myInstance">


<MTSGeometry Name="Mesh_1">
<Vertices>[0.352778483334744 0 0][0.705556966669489 0 0][0.705556966669489 0 -0.352778483334744][1.05833545000423 0 -0.352778483334744][0.705556966669489 0 -0.705556966669489][0.705556966669489 0 -1.05833545000423][0.352778483334744 0 -1.05833545000423][0.352778483334744 0 -0.705556966669489][0 0 -0.705556966669489][0.352778483334744 0 -0.352778483334744][0.352778483334744 0 0][0.352778483334744 0.819857195269946 0][0.705556966669489 0.819857195269946 0][0.705556966669489 0.819857195269946 -0.352778483334744][1.05833545000423 0.819857195269946 -0.352778483334744][0.705556966669489 0.819857195269946 -0.705556966669489][0.705556966669489 0.819857195269946 -1.05833545000423][0.352778483334744 0.819857195269946 -1.05833545000423][0.352778483334744 0.819857195269946 -0.705556966669489][0 0.819857195269946 -0.705556966669489][0.352778483334744 0.819857195269946 -0.352778483334744][0.352778483334744 0.819857195269946 0]</Vertices>
<VertexIndices>[0][1][11][1][12][11][1][2][12][2][13][12][2][3][13][3][14][13][3][4][14][4][15][14][4][5][15][5][16][15][5][6][16][6][17][16][6][7][17][7][18][17][7][8][18][8][19][18][8][9][19][9][20][19][9][10][20][10][21][20]</VertexIndices>
</MTSGeometry>
</MTSInstance>

and I tryed to put this code inside the loaded scene and, after, via javascript, I call the vmp.execute( the same mtx code ) the mesh will create and the scene contains the mesh inside the loaded scene and the mesh created via javascript.

is there other way to update the scene for mesh created at runtime?


thank you in advance
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Try:

vmp.SetProperty('MTSScene','nerd',1,'mts_int');

"nerd" is the "needs render" property. Let me know if that helps.
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
rik
Member
Posted Hide Post
thank you for the reply and the information.


I've solved the problem using <MTSScene Version="330"> ... mtx mesh code... </MTSScene>


thank you again
 
Posts: 34 | Registered: March 17, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    mesh at runtime