[Plugin] Object 3d [Alpha 0.3]

Post your completed addons to share with the community

Post » Sun Feb 19, 2012 1:09 am

Hi,
after some playing with the javascript-library JSC3D for loading obj-files, I've created a little plugin to use it within C2.

Update: Please update the plugin - version 0.3

Updates in version 0.3:
-) Hopefully fixed the WebGL bug.
-) Changed actions: values for loading time and scaling/rotation- can get set - depending on the complexity of the object.
Sidenote: The object in the demo is very small - scale it do 100 (- realsize is scalefactor 1 -) to see it.
Woohoo - works even now on my old android 1.5 device (5 FPS) ( - the canvas is on the wrong position but for now it's ok ).

Demo + Plugin version 0.3

_________

Update in version 0.2: Objects are now on their own canvases in C2 - seems it worked only with WebGL disabled.
Demo + Plugin version 0.2
(The button "reload" and the first loading doesn't work in the webdemo. It works locally - perhaps i've given to less loading/rendering time. Maybe the other buttons work fine in the webdemo.)

_________

The plugin "Object 3d" can load and render an obj-file into the canvas of Construct2 and can do some simple transformations (rotate, move, scale) with that object. The plugin doesn't work with the "Preview".

Actions 0.1:


Properties 0.1:



Demo 0.1
Plugin 0.1

How to load a obj-file:
specify the path at the properties:

my obj-file is located next to my capx in a folder "obj":


After exporting you should get a file c2Jsc3d.js - this is for the loading - please don't delete it.


How you can create obj-Files: Blender, Wings3D, Art of Illusion,..

Notes:
1) Version 0.1 can load and render only one obj-file.
2) The plugin is in alpha at the moment. However it works sometimes.

@Development: >=0.2: The rendering is done in an offscreen-canvas because I suppose the c2-runtime doesn't like a direct rendering-repaint-thread. The "estimated time" is the time that this rendering/repainting thread should take until it gets killed. If anybody knows a better way - let me know.

All suggestions are welcome,
Joe7   Joe72012-02-21 19:20:12
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sun Feb 19, 2012 2:09 am

It might work in "Preview" if you could put these two dependency files in to one file.
Reference: two files in dependencyrexrainbow2012-02-19 02:09:44
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sun Feb 19, 2012 8:06 am

i cant display any 3d model (?) where i must copy js. libraries?
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sun Feb 19, 2012 10:18 am

@rexrainbow: Thanks. I've made an update. However the preview don't work because a local obj-file get loaded. I don't know if or how i can get the path for C2 and/or the preview.

@delgado: Delete these both old-libraries and update the plugin. The needed library should become created now next to the index.html. Joe72012-02-19 10:20:03
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sun Feb 19, 2012 9:56 pm

i only see a white background with some buttons in firefox and chrome on your demo website... the load button does nothing either?
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Sun Feb 19, 2012 10:21 pm

wow, that's awesome, people are gonna love this
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Feb 20, 2012 12:57 am

white background and few buttons here too...plz explain better how to use it,ty
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Mon Feb 20, 2012 7:36 am

ok, open the demo page and click on the Button "Load". After that perhaps you see a 3D-object and you can rotate,move and scale it with the buttons (values from the textfields). If it works be happy - if not have a smile - its only alpha this time.
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Mon Feb 20, 2012 8:21 am

Will you make it so we can make the preloaded more attractive? Add a expression to get the total amount loaded, then we could set the width of our pre designed preloaded to that value ;). Also will collisions be possible? That way we could make 3D games :o
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Mon Feb 20, 2012 10:42 am

where i can get the:
c2jsc3d.js
c2runtime.js

?
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests