Skip to content
Open

Rc #4

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
28b6bb5
testing new loading
Mar 23, 2011
672b975
new collada dynamic
Mar 25, 2011
2a1acb6
almost done loader
Mar 30, 2011
17e2add
Lighting issue on Mac 10.6
Mar 30, 2011
5bb62ef
changed C3DL_MAX_LIGHTS to 8
Mar 30, 2011
bf21538
testing different init
Mar 31, 2011
141f578
added Dynamic Collada Loading and kept preloading but added mutli-fi…
Mar 31, 2011
a1815d6
fix multi loader tests to make them more useful
Mar 31, 2011
d1213aa
Fixed loader tests
Apr 6, 2011
d7c2b5e
Added ability to remove light by index along with a test.
Apr 8, 2011
3293624
Renamed picking.onMouseDown to picking.pickingReaction
Apr 11, 2011
e8075ba
modified scene to accept mousedown, mouseup and click as acceptable i…
Apr 11, 2011
88f192e
added tests for three different picking events.
Apr 11, 2011
fe5518e
fixed typos in tutorials and added tutorial 9 to repository.
Apr 11, 2011
e64b0b2
fixed documentation comment for setPickingCallback.
Apr 11, 2011
e5136da
fixed misplaced comment.
Apr 11, 2011
69d2a45
Fixed comments/documentation for OrbitCamera.pitch.
Apr 11, 2011
1bda1ce
Added test for dynamic collada deletion.
Apr 11, 2011
78fc052
Created deleteFile function in ColladaManager, created test that call…
Apr 15, 2011
8afb0ec
Added yawLocal and roll functions to OrbitCamera, created test to dem…
Apr 15, 2011
d89e359
Created a new function for OrbitCamera called rotate. It receives an…
Apr 18, 2011
65c2bdd
bug fix
May 2, 2011
6582ef4
reverted old effects test and bug fix
May 2, 2011
6c13278
bug fixes
May 2, 2011
036844f
Added regular expressions to mergeChildData function of colladaLoader…
May 4, 2011
25e7bcb
copy ready attribute
May 4, 2011
cb95025
mipmap fix
May 5, 2011
deb831a
Switched one light to be removed by the variable name used in the mai…
May 9, 2011
b8ea10d
Fixed errors in tut.js and yawpitchroll.html. Added tutorial9b.html.
May 9, 2011
692bb3e
Removed yaw (global up), renamed yawLocal to yaw, renamed rotate to r…
May 9, 2011
10cf8f5
Modified setNearClippingPlane and setFarClippingPlane to prevent over…
May 31, 2011
f98762b
Modified onMouseDown event in picking.js to use clientHeight and clie…
Jun 3, 2011
a561f51
changed picking hit calculation to take the area of the triangle in a…
Jun 8, 2011
a233611
Added setSize function to Scene.
Jun 8, 2011
8fd7978
added resize test.
Jun 13, 2011
f2cff6b
Modified resisze test to explain non-square canvases better. Modifie…
Jun 15, 2011
f63d810
removed old backup method of prepping images (no longer supported), r…
Jun 22, 2011
e6338e4
.
Jun 22, 2011
142c62a
Renamed most instances of collada to model to move towards allowing o…
Jun 24, 2011
8d6faf7
Started converting demos to use model instead of collada.
Jun 24, 2011
c66bb1f
Changed Collada to Model in more tests, model code (actor.js, constan…
Aug 16, 2011
5bb28d6
Merge branch 'bug95'
Aug 17, 2011
36bf4b9
Merge branch 'bug123'
Sep 13, 2011
1aa6c8f
Merge branch 'bug131'
Sep 13, 2011
6b150f3
Merge branch 'bug42'
Sep 13, 2011
b6c478e
Standardizing tests in preparation for release.
Sep 13, 2011
d7f4db4
Merge branch 'bug140'
Sep 19, 2011
d765a5b
Merging with branch bug140
Sep 19, 2011
c2838d3
Merging with bug140
Sep 19, 2011
a3958f3
Merge branch 'bug138'
Sep 19, 2011
45d44a2
merging bug 138
Sep 19, 2011
6be480c
completing merge with bug138
Sep 19, 2011
d624e09
Merge branch 'bug136'
Sep 19, 2011
40cdccf
merge with bug136
Sep 19, 2011
cfde553
Adding tutorials 10, 11 and 12 to repo.
Sep 19, 2011
970ed58
Merge branch 'bug139' into RC
Sep 19, 2011
ee0a704
merging with branch bug139
Sep 19, 2011
72d2f91
Merge branch 'bug155' into RC
Sep 19, 2011
6bd32f0
Merge branch 'bug156' into RC
Sep 19, 2011
2aae13d
Merge branch 'bug122' of git://github.com/sonnilion/c3dl into RC
Sep 19, 2011
c5a1825
Merge branch 'bug134' of git://github.com/sonnilion/c3dl into RC
Sep 20, 2011
dd2507f
Merging with Sonnilion's bug134.
Sep 20, 2011
60f60c8
Reconciling merge of Sonnilion's bug133 with this branch.
Sep 20, 2011
93a68ca
De-tabbing (again)
Sep 20, 2011
e6a798d
Further de-tabbing
Sep 20, 2011
d581897
Standardizing location of { in code blocks
Sep 27, 2011
086f026
Standardizing function head comments.
Oct 27, 2011
926a765
Minor fixes for cross-browser compatibility and spelling.
Nov 15, 2011
053df2b
Minor edits for efficiency, comments etc.
Dec 12, 2011
42acff1
Removed extraneous comments.
Dec 12, 2011
a209e63
Modified c3dl.init to remove initialization callbacks that have alrea…
Dec 12, 2011
d7500d7
Comented out problematic picking code. (calls to rayOBBIntersect in m…
Dec 15, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
164 changes: 82 additions & 82 deletions c3dl-dev/J3DXplorer/J3DXplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,101 +18,101 @@ var urls = ["http://www.google.com", "http://www.senecac.on.ca",
"http://www.twitter.com",
"http://www.c3dl.org","http://www.mozilla.com/en-US/firefox/personal.html"];
var imgs = ["windowTex_google.png",
"windowTex_seneca.png",
"windowTex_twitter.png",
"windowTex_c3dl.png",
"windowTex_firefox.png"];
"windowTex_seneca.png",
"windowTex_twitter.png",
"windowTex_c3dl.png",
"windowTex_firefox.png"];

function J3DXplorer_main(canvasName)
{
scn = new c3dl.Scene();
scn.setCanvasTag(canvasName);
var renderer = new c3dl.WebGL();
scn.setRenderer(renderer);
scn.init(canvasName);
if(!renderer.isReady()){
scn = new c3dl.Scene();
scn.setCanvasTag(canvasName);
var renderer = new c3dl.WebGL();
scn.setRenderer(renderer);
scn.init(canvasName);
if(!renderer.isReady()){
var imgtag=document.getElementById("screenshot");
imgtag.style.display="block";
var canvas=document.getElementById(canvasName);
canvas.style.display="none";
}
else{
var j=0;
// spinning 'windows'
for(var i = 0; i < MAXOBJ; i++){
var obj = new c3dl.Collada();
obj.init("J3DXplorer_window.dae");
var ranScale = 1 - ( Math.floor(Math.random()*11) / 20);
var ranScaleVector = new Array(ranScale,ranScale,ranScale);
var ranYaw = Math.floor(Math.random()*361) ;
var ranPitch = .5 - Math.floor(Math.random()*10) / 10 ;
var ranRoll = .5 - Math.floor(Math.random()*10) / 10 ; ;
var ranVel = 0.0001 + (Math.floor(Math.random()*11) * 0.00005);
obj.scale(ranScaleVector);
obj.yaw(ranYaw);
obj.pitch(ranPitch/1.5);
obj.roll(ranRoll/1.5);
obj.setAngularVel([0,ranVel,0]);
}
else{
var j=0;
// spinning 'windows'
for(var i = 0; i < MAXOBJ; i++){
var obj = new c3dl.Model();
obj.init("J3DXplorer_window.dae");
var ranScale = 1 - ( Math.floor(Math.random()*11) / 20);
var ranScaleVector = new Array(ranScale,ranScale,ranScale);
var ranYaw = Math.floor(Math.random()*361) ;
var ranPitch = .5 - Math.floor(Math.random()*10) / 10 ;
var ranRoll = .5 - Math.floor(Math.random()*10) / 10 ; ;
var ranVel = 0.0001 + (Math.floor(Math.random()*11) * 0.00005);
obj.scale(ranScaleVector);
obj.yaw(ranYaw);
obj.pitch(ranPitch/1.5);
obj.roll(ranRoll/1.5);
obj.setAngularVel([0,ranVel,0]);

// generate a random number which will be used to index
// into a list of urls/images
// Math.random gives us a number from [0,1), so add a buffer
// to get the 1.
//var rand = Math.floor(((Math.random() + 0.2) * 4));
// generate a random number which will be used to index
// into a list of urls/images
// Math.random gives us a number from [0,1), so add a buffer
// to get the 1.
//var rand = Math.floor(((Math.random() + 0.2) * 4));

obj.url = urls[j];
obj.setTexture(imgs[j]);
j++;
obj.url = urls[j];
obj.setTexture(imgs[j]);
j++;
if(j==5)
j=0;
scn.addObjectToScene(obj);
}
// c3dl logo
var logo = new c3dl.Collada();
logo.init("c3DL_logo.dae");
logo.scale([0.1,0.1,0.1]);
logo.setAngularVel([0,-0.001,0]);
logo.setPickable(false);
scn.addObjectToScene(logo);
j=0;
scn.addObjectToScene(obj);
}
// c3dl logo
var logo = new c3dl.Model();
logo.init("c3DL_logo.dae");
logo.scale([0.1,0.1,0.1]);
logo.setAngularVel([0,-0.001,0]);
logo.setPickable(false);
scn.addObjectToScene(logo);

// SkySphere
var skySphere = new c3dl.Collada();
skySphere.init("SkySphere.dae");
skySphere.setAngularVel(new Array(0,.00005,0));
skySphere.setPickable(false);
scn.addObjectToScene(skySphere);
//
//scn.setBackgroundColor([0.15,0.15,0.15]);
scn.setAmbientLight([1,1,1]);
cam.setPosition([0,0,-30.0]);
cam.setLookAtPoint([0,0,0]);
scn.setCamera(cam);
scn.startScene();
scn.setPickingCallback(picking);
}
// SkySphere
var skySphere = new c3dl.Model();
skySphere.init("SkySphere.dae");
skySphere.setAngularVel(new Array(0,.00005,0));
skySphere.setPickable(false);
scn.addObjectToScene(skySphere);
//
//scn.setBackgroundColor([0.15,0.15,0.15]);
scn.setAmbientLight([1,1,1]);
cam.setPosition([0,0,-30.0]);
cam.setLookAtPoint([0,0,0]);
scn.setCamera(cam);
scn.startScene();
scn.setPickingCallback(picking);
}
}

function picking(pickingObj)
{
var objectsHit = pickingObj.getObjects();
{
var objectsHit = pickingObj.getObjects();

if( objectsHit.length > 0 )
{
var sepiaEffect = new c3dl.Effect();
sepiaEffect.init(c3dl.effects.SEPIA);
// document.addTab(objectsHit[0].url);
// window.open(objectsHit[0].url, objectsHit[0].url, "resizable=yes,scrollbars=yes,status=yes");
window.location=objectsHit[0].url;
objectsHit[0].setEffect(sepiaEffect);
for(var i = 0; i < MAXOBJ; i++){
if(objectsHit[0].url == scn.getObj(i).url)
scn.getObject(i).setEffect(sepiaEffect);
}
}
if( objectsHit.length > 0 )
{
var sepiaEffect = new c3dl.Effect();
sepiaEffect.init(c3dl.effects.SEPIA);
// document.addTab(objectsHit[0].url);
// window.open(objectsHit[0].url, objectsHit[0].url, "resizable=yes,scrollbars=yes,status=yes");
window.location=objectsHit[0].url;
objectsHit[0].setEffect(sepiaEffect);
for(var i = 0; i < MAXOBJ; i++){
if(objectsHit[0].url == scn.getObj(i).url)
scn.getObject(i).setEffect(sepiaEffect);
}
}
}
20 changes: 10 additions & 10 deletions c3dl-dev/J3DXplorer/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<html>
<head>
<title>Cavas3D test environment</title>
<!--Our directory structure is 2 above. If you download the entire repository as is, this will run-->
<script language="javascript" src="../../c3dl/c3dapi.js"></script>
<title>Cavas3D test environment</title>
<!--Our directory structure is 2 above. If you download the entire repository as is, this will run-->
<script language="javascript" src="../../c3dl/c3dapi.js"></script>
<script language="javascript" src="J3DXplorer.js"></script>

</head>

<body>
<canvas id="J3DXplorer" width="500" height="500">
</canvas>
<img id="screenshot" src="frontpagess.png" width="500", height="500" style="display:none"></img>
<font face="verdana">
<span id="debug"> </span>
</font>
<canvas id="J3DXplorer" width="500" height="500">
</canvas>
<img id="screenshot" src="frontpagess.png" width="500", height="500" style="display:none"></img>
<font face="verdana">
<span id="debug"> </span>
</font>
</body>
</html>
24 changes: 12 additions & 12 deletions c3dl-dev/asteroids3/asteroids.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
<title></title>
<!-- Set the path to the c3dl library and load the script -->
<link rel="stylesheet" href="style.css"/>
<script type="application/javascript" src="../../c3dl/c3dlapi.js" ></script>
<script type="application/javascript" src="../../c3dl/c3dapi.js" ></script>
<script type="application/javascript" src="asteroids.js"></script>
</head>

<body>
<!-- Add a canvas element to the page. It is scripted by using its id -->
<div class="gameblock">
<div class="mainwindow">
<div class="mainwindow">
<audio src="pew.ogg" id="pew"></audio>
<canvas id="mainwindow" width="500" height="500"></canvas>
</div>
<div class="sidebar">
<div class="hudwindow">
<canvas id="hud" width="150" height="200"></canvas>
</div>
<div id="score" class="scorearea">
Score:
</div>
<canvas id="mainwindow" width="500" height="500"></canvas>
</div>
<div class="sidebar">
<div class="hudwindow">
<canvas id="hud" width="150" height="200"></canvas>
</div>
<div id="score" class="scorearea">
Score:
</div>
</div>
<br />
<span id="debug"></span>
Expand Down
Loading