Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<barnaby>
Posted
This is probably a really dumb question, and I'm not exactly sure how to explain my problem, but...

I'm trying to embed some zoomview content on a web page. The web page is scaleable as is the embed. I've set zoomview to show the whole image as default. I'd like the images to be hard up against the left margin. But they are always centred. Is there any way around this?
 
Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
Well over a month of trying to sort this out and this is the best I can manage...

I've added a bit of javascript to my html (in the <head> tag).:

// scene is my vet instance
var scene;

function do_placer()
{
var pw = 480;
var ph = 480;
var ua = navigator.userAgent.toLowerCase();
var is_ie = (ua.indexOf('msie') != -1 );
var is_moz = (ua.indexOf('mozilla') != -1);
var ww = 1;
var wh = 1;
if(is_moz)
{
ww=innerWidth;
wh=innerHeight;
} else if(is_ie) {
ww=document.body.clientWidth;
wh=document.body.clientHeight;
}
var uo = 0.5;
var vo = 0.5;
if ((ph/pw) > (wh/ww))
{
uo = 0.5 + ((ph/pw)*(((ww/wh) - (pw/ph))/2));
vo = 0.5;
} else {
uo = 0.5;
vo = 0.5 + ((pw/ph) * (((wh/ww) - (ph/pw))/2));
}
scene.SetProperty('MTSTimeElem.mySmoothZoom','PosU',uo,'mts_real');
scene.SetProperty('MTSTimeElem.mySmoothZoom','PosV',vo,'mts_real');
}

then in the <body> tag,
scene = new MTSPlugin("../zoomview/filename.mtx", "100%", "100%", "../bkey.mtx","<img src='../images/filename.jpg'>");
setTimeout("do_placer()",1000);

inside the ZoomView mtx file:

<MTSTimeElem Name="mySmoothZoom" Type="MTSZoomView" On="1" Snap="0" PosU="10" PreAnimator="1" BaseName="filename_img/filename.mzv" ImageSize="1024 1024" TileSize="256" Overlap="1" Zfit="1"/>

... and after the Actions and Interactors have been declared...

<MTSTimeElem Name="FadeIn" Type="Keyframe" Duration="3" On="1">
<Target Name="MTSTimeElem.mySmoothZoom" Property="opac" Timeline="T1"/>
<Time>0 2 3</Time>
<Timeline Name="T1" Type="1D">[0][0][1]</Timeline>
</MTSTimeElem>

so, 1 second after the ZoomView starts loading its position is modified.

a version of this is online at www.paolalenti.com/iprodotti/test/index.html

but I'm having problems with the zoomview jumpin or rendering twice leaving a ghost of its starting position.
 
Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
continuing my one man thread, boy is it a lonely job...

I think the ghosting/jumping might be mac player issues related to the setProperty() function, but I haven't had time to verify yet.

The 'FadeIn' animation doesn't work properly with 3 keyframes, but does with 2

I decided on an alternative method of positioning the content which has slightly different results:

in the html header:

<script type="text/javascript">
<!--
var scene;
var uo;
var vo;
var pw = 480;
var ph = 480;
var ua = navigator.userAgent.toLowerCase();
var is_ie = (ua.indexOf('msie') != -1 );
var is_moz = (ua.indexOf('mozilla') != -1);
var ww;
var wh;
var sw;
var sh;
-->
</script>

in the body:

<script type="text/javascript">
<!--
function place_scene()
{
if(is_ie)
{
ww=document.body.clientWidth;
wh=document.body.clientHeight;
} else if(is_moz) {
ww=innerWidth;
wh=innerHeight;
} else {
ww=1;
wh=1;
}
if ((pw/ph) > (ww/wh))
{
sw = "100%";
sh = Math.floor(100*(ph/pw)*(ww/wh)) + "%";
} else {
sw = Math.floor(100*(pw/ph)*(wh/ww)) + "%";
sh = "100%";
}
scene = new MTSPlugin("../zoomview/myfilename.mtx", sw, sh, "../bkey.mtx","<img src='../images/myfilename.jpg'>");
}
setTimeout("place_scene()",100);
-->
</script>

This sizes the content as a function of window size AND image size so that the content has the proportions of the original image and a maximum vertical OR horizontal size determined by the available space.

It has a defect in that it leaves an incomprehensible border around the content (nothing to do with the html document's margins)

Furthermore if I look at the source of the page in Internet Explorer 5.2 it is completely weird (an invisible layer) the same source in Safari is correct.

Weird
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of DavidR
Posted Hide Post
Hi Barnaby
I read your posts and hate to see you alone in a crowd...solving your own problems. Hello Viewpoint techies!
So I am gong to take a stab at helping to solve your dilemna. First, you indicated that your testing is on a Mac in Safari and that the initial ghost image appears centered, then jumps left...you might want to know that this is precisely what happens to me with a Windows XP system running IE.
----
Now, about the positioning of your Zoomview content....have you attempted positioning the content through the use of Hyperview? One may establish the coordinate system (position), rectangle (size), and camera (relative to coordinate system). You may have consider this in your lonely contemplations...and I don't have a specific answer, but thought that this might send you down a worthy path.
regards
DavidR Cool
 
Posts: 308 | Location: Atlanta Georgia | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
David

thanks for you reply, I'll try digging into Hyperview. At the moment the second solution is the better of the two [imperfect] ones I've managed to get 'working'

My client is getting extremely frustrated, having gone from amazed at the potential of Zoomview to show their products in detail to despondency that placing the content on a web page should be so difficult. They keep threatening to get an 'expert' in to solve my problems when I thought that was what I was...
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of duncan
Posted Hide Post
Hi Barnaby,

Have you thought about putting your ZoomView on a plane? Put the camera in still mode and position the plane up against the left margin. Then just map the texture coordinates (clicked on) to the ScrX and ScrY values of the Zoom in animation, for example:


<MTSHandle Event="MouseLeftClick" Action="ZoomAnimIn" x="MTSEvent.TxtCoords.x" y="MTSEvent.TxtCoords.y" z="2"/>


Sorry you went so long without a reply, I guess must have looked over the thread.
 
Posts: 381 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
Duncan, I'll give it a try... actually one of the first attempts was using a plane but I forgot about putting the camera in still mode..
 
Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
Well I couldn't get the zoomview on plane thing to do what I wanted. I'm currently playing with putting the content on a hotspot.... which almost seems to work...


<MTSScene Version='308'>
<MTSSceneParms RenderMode='LightTexture' AccumMax='12' EdgeBias='1' AntiAliasMinimumMilliSecs='333' />
<MTSCamera Mode="Still">
</MTSCamera>

<MTSTextureMap Name="my_image" x="256" y="256"/>

<MTSTimeElem Name="mySmoothZoom" Type="MTSZoomView" On="1" Snap="0" PosU="10" PreAnimator="1" BaseName="aqua_25_img/aqua_25.mzv" ImageSize="1024 1024" TileSize="256" Overlap="1" Zfit="1">
<Target Name="MTSTexture.my_image"/>
</MTSTimeElem>

<MTSAction Name="ZoomPan">
<MTSSetProperty Target="mySmoothZoom::Snap" Value="1"/>
<MTSSetProperty Target="mySmoothZoom:Big GrinelU" Value="dx"/>
<MTSSetProperty Target="mySmoothZoom:Big GrinelV" Value="dy"/>
<MTSSetProperty Target="mySmoothZoom:Big Grinel0" Value="1"/>
</MTSAction>

<MTSAction Name="ZoomAnimIn">
<MTSSetProperty Target="mySmoothZoom::Snap" Value="1"/>
<MTSSetProperty Target="mySmoothZoom::ScrX" Value="x"/>
<MTSSetProperty Target="mySmoothZoom::ScrY" Value="y"/>
<MTSSetProperty Target="mySmoothZoom::IncZ" Value="z"/>
<MTSSetProperty Target="mySmoothZoom::TimT" Value="1"/>
</MTSAction>

<MTSAction Name="ZoomAnimOut">
<MTSSetProperty Target="mySmoothZoom::Snap" Value="1"/>
<MTSSetProperty Target="mySmoothZoom::IncZ" Value="z"/>
<MTSSetProperty Target="mySmoothZoom::TimT" Value="1"/>
</MTSAction>

<MTSInstance Name="Simple_0" DoShadow="0">
<MTSInstance Name="Layer2D_0" >
<LayerData Texture="MTSTexture.my_image" Shadow="0" AnchorWidget="1" WidgetLine="0" AlwaysVisible="1" SrcPinRel="1" SrcPinFlag="0" SrcPin="0 0" DstPinRel="1" DstPinFlag="0" DstPin="0 0"/>
</MTSInstance>
</MTSInstance>

<MTSInteractor Name="MTSCameraNavi">
<RemoveStates/>
<MTSHandle Event="MouseLeftDown" Action="ZoomAnimIn" z="2" x="MTSEvent::ucrd" y="MTSEvent::vcrd"/>
<MTSHandle Event="MouseRightDown" Action="ZoomAnimOut" z="-2"/>
<MTSHandle Event="MouseDrag" Action="ZoomPan" dx="MTSEvent::_dx_" dy="MTSEvent::_dy_"/>
</MTSInteractor>

<MTSTimeElem Name="FadeIn" Type="Keyframe" Duration="2" On="1">
<Target Name="MTSTimeElem.mySmoothZoom" Property="opac" Timeline="T1"/>
<Time>0 1</Time>
<Timeline Name="T1" Type="1D">[0] [1]</Timeline>
</MTSTimeElem>

</MTSScene>
 
Reply With QuoteEdit or Delete MessageReport This Post
<barnaby>
Posted
amazingly I think i got it working.

the version on www.paolalenti.com/iprodotti/test/index.html works with the javascript as per my post of July 13th

I changed my animation in the mtx file:

<MTSTimeElem Name="FadeIn" Type="Keyframe" Duration="3" On="1">
<Target Name="MTSTimeElem.mySmoothZoom" Property="opac" Timeline="T1"/>
<Time>0 4 5</Time>
<Timeline Name="T1" Type="1D">[0][0.01][1]</Timeline>
</MTSTimeElem>

the second keyframe being slightly different to the first makes all the difference... no ghost everything else working ok.

Smile
 
Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community