Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    How to set scale to Instance?

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Member
Posted
Hi there.I am new here.Please help me.

I follow the pattern with this topic http://viewpoint.infopop.cc/eve/forums/a/tpc/f/3632928096/m/3101002932
But I still can't resize the Instance size

<!--this is my html code-->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<script language="javascript" src="Eovia/MTS3Interface.js"></script>
<script language="VBScript" src="Eovia/mtsAxDetect.vbs"></script>

<script language="javascript">
<!--
var vmp; //This global variable is for the VET content
function Resize()
{
var value = document.getElementById('size').value;
if (value !='')
{
vmp.ExecuteVETScript("MTSInstance.CUBE.Scale.x="+value+";");
}
else alert("Invalid or blank size value");
}
//-->
</script>
</HEAD>
<BODY>
<script language="javascript">
vmp = new MTSPlugin("cubel.mtx", 400, 300, "", "simple", "GenieMinimumVersion=50332496");
</script>
<form>
<input type="text" name="size" />
<input type="button" name="CubeResize" value="Resize" onclick="javascript:Resize();"/>
</form>
</BODY>
</HTML>


<!-- And this is my mtx file -->
<?xml version="1.0"?>
<MTSScene Version="308" >
<MTSSceneParms RenderMode="LightTexture" BlendShadow="1" AccumMax="0" EdgeBias="1" />
<MTSCamera OrbitDist="51.14323" >
<Rotate x="35.26431" y="135.00002" z="0" />
<ViewLocation x="0" y="0" z="4" />
</MTSCamera>
<MTSInstance Name="UNIVERSE" >
<MTSInstance Name="CUBE" >
<Transform>
<Scale x="0.0866" y="0.0866" z="0.0866" />
<Position x="-0.13374" y="2.5" z="1.356" />
</Transform>
</MTSInstance>
</MTSInstance>
<MTSTimeElem Type="MTSStream" Name="cubel" Path="cubel.mts" >
<Target Name="MTSInstance.UNIVERSE" />

</MTSTimeElem>
</MTSScene>



Is it because that my instance "CUBE" is inside instance "UNIVERSE" ???
I don't want to modify mtx file so I try to access edit DOM in html with many way like

MTSInstance.CUBE.Scale.x
MTSInstance.UNIVERSE.CUBE.Scale.x
MTSInstance.UNIVERSE.MTSInstance.CUBE.Scale.x

but it doesn't work at all.Please help me.

Zip/GZ archive3d_resize.zip (15 KB, 4 downloads) source code
 
Posts: 3 | Registered: August 12, 2007Reply With QuoteEdit or Delete MessageReport This Post
EnIgMaTiCScOrPioN
Member
Picture of e_phoenix13
Posted Hide Post
Hi secretjob...

Update your MTX file as follows:
1. Change the Scene Version to 330.
2. Add a VETScriptInterpreter at the end of the MTX file before closing the Scene tag.

Check the updated files attached.


Cheers,

Anup

Zip/GZ archive3d_resize_new.zip (15 KB, 7 downloads)
 
Posts: 557 | Location: India | Registered: February 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
Thank you Smile it works well
Now I can resize,rotate,shear,locate position

I have one more question how can I get shear position value?
For size I use: vmp.GetProperty("MTSInstance.CUBE","scl_" , "mts_pnt3d");
For Rotate I use: vmp.GetProperty("MTSInstance.CUBE","rot_" , "mts_pnt3d");
For Locate position I use: vmp.GetProperty("MTSInstance.CUBE","loc_" , "mts_pnt3d");

but I can't get shear value??? I try "shr_","she_",etc... but it won't work at all.what is string should I use to get shear value?

By the way, I found "scl_","rol_","loc_" by reading many topics.Is there any document that tell me about these string?
 
Posts: 3 | Registered: August 12, 2007Reply With QuoteEdit or Delete MessageReport This Post
EnIgMaTiCScOrPioN
Member
Picture of e_phoenix13
Posted Hide Post
You can get the code reference here...

http://developer.viewpoint.com/dc/xml.shtml


Hope this helps.


Cheers,

Anup
 
Posts: 557 | Location: India | Registered: February 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
You would just call the full name of the property ("Shear") since it doesn't have an abbreviation in this case:

vmp.GetProperty("MTSInstance.myInstance","Shear","mts_pnt3d")

You can usually just call a property by its full name instead of its four-letter abbreviation whenever you want. However, good practice is to call the property by its abbreviation when an abbreviation is available. Example attached.

Regards

Zip/GZ archivegetshear.zip (8 KB, 6 downloads)
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
So it was "Shear" with S capital letter.Ha ha

Thank you very much.

http://developer.viewpoint.com/dc/xml.shtml
with this link I can now understand almost of them. Smile

This message has been edited. Last edited by: secretjob,
 
Posts: 3 | Registered: August 12, 2007Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    How to set scale to Instance?