Page 1 of 1

Firefox o2c plugin code

PostPosted: Wed Feb 23, 2011 4:47 pm
by showphone
None of the suggestions for successfully using the Firefox 02c plugin worked, so I contacted Dr. Klaus Kremer at o2c. He sent me the following html code and it works great for both Firefox and IE. His code is red, I spliced in the rest of the code to get notification of the controls I wanted:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<BODY
BGCOLOR="#000000" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#0F0000">
<div align="center">
<table border="0" cellpadding="4" cellspacing="4" style="border-collapse: collapse" width="100%" height="100%">
<tr>
<td width="100%" align="center" height="100%">
<p align="center" style="margin-top: 0; margin-bottom: 0">
<font face="Verdana, Arial" size="1" color="#FFFFFF">Shift+left button for Pan,
Ctrl+left button for Zoom, Right Click for settings.</font><br><br>
<script type="text/javascript"
src="http://www.o2c.de/utilities/o2c-utils.js"></script>
<script type="text/javascript">
o2cInsertObject('o2c_id1', '2.0.0.57', 640, 480,
'Phi="227.864700"; ' +
'Psi="39.359985"; ' +
'Zoom="0.903993"; ' +
'PanX="-0.224418"; ' +
'PanY="1.685330"; ' +
'ObjectURL="cubeSmith.o2c"');
</script>
</body></html>


Change the ObjectURL to your Object of course and to your location if not in the same folder.

He gave me a good tip on getting the desired opening appearance of your Object. Play your object by clicking on it's o2c file. Adjust it too how you want it with the spin, pan and zoom controls. Right click it and you will see that particular html is copied to the clipboard. Copy and paste the generated Phi, Psi, Zoom, and Pan information into your html code. Now that position will be the o2c Object starting position.

Long live o2c and DataCAD.

Re: Firefox o2c plugin code

PostPosted: Wed Feb 23, 2011 5:23 pm
by joshhuggins
Thanks for sharing this good info!

Re: Firefox o2c plugin code

PostPosted: Wed Feb 23, 2011 6:03 pm
by Mark F. Madura
Here is the minimum code required to embed an o2c object in your web page:
Code: Select all<script type="text/javascript" src="http://www.o2c.de/utilities/o2c-utils.js"></script>
<script type="text/javascript">
    o2cInsertObject('o2c_id1', '1.9.9.135', 640, 480, 'ObjectURL="MyObject.o2c"');
</script>

Note: Setting the version number to 1.9.9.135 establishes the minimum player version the user has to have installed in order to view your object. If they are viewing the object in Internet Explorer using the o2c Player that ships with DataCAD (1.9.9.149 with raytracing), you do not want to prompt them to install a newer version. For other browsers including Firefox and Chrome, they will be prompted anyway.

Edit:

You can also specify the width and height in percent as a string. For example ...
Code: Select all<script type="text/javascript" src="http://www.o2c.de/utilities/o2c-utils.js"></script>
<script type="text/javascript">
    o2cInsertObject('o2c_id1', '1.9.9.135', '100%', '100%', 'ObjectURL="MyObject.o2c"');
</script>

Re: Firefox o2c plugin code

PostPosted: Wed Feb 23, 2011 6:43 pm
by showphone
Hi Mark,

Using this forum as email to get answers distributed.

What I REALLY like about o2c is that it can be an ActiveX control, so whoever you're presenting to doesn't have to be a DataCAD user or even download the o2c Player. For such a person, when they are prompted to accept the ActiveX or install the plugin, will they therefore get the latest version or could you make sure they get the DataCAD version by putting that version in your code? Because I'd be happy to use a version other than the latest version if it worked better with DataCAD. Thanks.

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 12:24 pm
by joshhuggins
Using the Javascript method seems to not download the file to the users temp files either which is nice if you don't want the user to have access to the file. Is there a way to disable the Right Click, Save Object option? I tried searching for a tag in the Arcon forums but I couldn't get a good translation going.

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 1:38 pm
by Mark F. Madura
joshhuggins wrote:Is there a way to disable the Right Click, Save Object option? I tried searching for a tag in the Arcon forums but I couldn't get a good translation going.
LocalSaveAllowed
<PARAM NAME="LocalSaveAllowed" VALUE="-1">
Allows local saving of the downloaded object and its textures
Object will be saved as a non-compressed ACO file
Texture will be saved in BMP format

See http://www.datacad.com/o2c/o2c_for_programmers.htm

MFM

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 3:08 pm
by joshhuggins
Awesome Mark, thanks! I didn't know that page was there. Wonder what other treasures I'm missin? Might want to sticky a post in the O2C area with the link for future use.

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 5:37 pm
by showphone
In order to test if the DataCAD version with ray tracing would be used if that particular version of the o2c player was referenced in the html, I changed the html to that particular version (1.9.9.149), uninstalled the o2c plugin (2.0.0.56) from Firefox and accessed the revised html. Firefox installed the newer plugin.

So it seems to me that there's no way to use Firefox with the older version of the plugin, therefore ray tracing in Firefox is not possible. Does anybody else see it differently? Thanks.

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 5:40 pm
by Mark F. Madura
That is correct. The raytracing option is only available in version 1.9.9.149 and Internet Explorer.

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 5:51 pm
by showphone
Ok, so I think I should put some directions in my html along with my control directions about pan and zoom that says "note, light and shadow effects can only be viewed using IE". Would that be a good way to go?

Re: Firefox o2c plugin code

PostPosted: Fri Feb 25, 2011 6:27 pm
by joshhuggins
I think your right.