Q3D V-2.4 [3D Physics + Skeletal Animation UPDATE]

Post your completed addons to share with the community

Post » Tue Dec 27, 2016 8:18 pm

@QuaziGNRLnose
Is there a simple demo on how to get a 3D character model (w/ walking animations) to work in a 2D environment?

I couldn't find anything like this in the tutorials.

So in a 2D environment the camera angle on the 3D character model would be locked to a diagonal view, the actual Player object will be a 2D invisible sprite that moves, and the 3D model will just position itself on top of this invisible sprite at all times - so 3D character model would be for appearance only.
Last edited by Badmiracle on Fri Dec 30, 2016 11:02 pm, edited 1 time in total.
B
69
S
24
G
9
Posts: 78
Reputation: 8,912

Post » Thu Dec 29, 2016 11:53 pm

My issues is that apply physics force to Z axis. the movement grid is X and Z and Y is Height. i can Move on X Axis. i can use local positioning but then is ignores Collision boxes. Pic of what i tried
Image
Pic of The Game
Image
B
6
S
2
Posts: 2
Reputation: 456

Post » Fri Dec 30, 2016 7:38 pm

fuego96 wrote:My very first Q3D test scene :D
https://www.scirra.com/arcade/other-games/q3d-the-baked-room-scene-13979

Image

@QuaziGNRLnose dear sir, would there be any way of accessing a mesh from the 3D scene?

It would be nice if I could simply reference the walls that are already in a scene (not necessarily from another individual model) to add box colliders. Like maybe...
Image

...so the "Model Meshname", if not empty (nor misspelled) *and* exists in the scene, would get used. Would be nice not having to recreate/re-position separate box colliders (for the floor and walls). Maybe a new "Q3D MeshBinder" plugin perhaps?

Speaking of colliders, "Collider Fit: Model" doesn't seem to work.
Image

The boxes and the first platform (left) are primitives made by Q3D, the second platform (right) is from Blender whose (Q3D Model) collider fit property is set to "Model". The collider debug shows the correct size, but the box still falls through.

Here is the .capx file (with the blender file in the Files Folder).
http://crxmedia.com:9180/test/ss/BoxColliderFitModelTest.capx

EDIT: Changing the values here...
Image

... to larger XYZ values would increase the BBox and solve the collision issue, at the cost of changing the size of the model and negating the intention for "Collider Fit: Model". Sadly this would mean that I have to key-in the dimensions for every wall (and endure the tedium of object placements).

Here's hoping it's an easy fix.


Collider Fit is independent of physics, it sets up the collider for the "collision" actions that you can visualize with collider debug on the objects properties. Oimo Physics bodies have their own independent collider, which can be viewed with the appropriate debug option in the oimo physics behaviour.
B
77
S
13
G
8
Posts: 1,973
Reputation: 9,891

Post » Fri Dec 30, 2016 7:45 pm

JacobWeaber wrote:My issues is that apply physics force to Z axis. the movement grid is X and Z and Y is Height. i can Move on X Axis. i can use local positioning but then is ignores Collision boxes. Pic of what i tried
Image
Pic of The Game
Image


Not sure what you're asking to be honest. It's best to avoid using the normal construct behaviors with Q3D objects as they aren't meant to work together (how are the 2D behaviours supposed to understand the 3D colliders they've never seen before). I see you have 2D physics and 8 Directions on some object, you should remove both of these and use "Q3D Oimo Physics", then implement the control logic with events. This is the only way Q3D supports any kind of understanding of 3D forces.
B
77
S
13
G
8
Posts: 1,973
Reputation: 9,891

Post » Fri Dec 30, 2016 9:22 pm

QuaziGNRLnose wrote:...Collider Fit is independent of physics... ...Oimo Physics bodies have their own independent collider...


@QuaziGNRLnose
Ah, indeed they ought to be different. Was fooled and couldn't immediately see the difference between the two, sorry.

I can understand that the Oimo Physics collider shape is initially bound to DefaultShape0 and that one could simply create a separately-sized box (collider) shape for Oimo Physics, but shouldn't the physics behavior initially have its own separate box collider adhering to the size calculated by "Collider Fit: Model"? It only seems natural.

QUESTION: Is there a Q3D Model expression so I could query the Collider Fit calculated width, depth and height -- so i could then automate the resizing of DefaultShape0 ?

It's about automatically creating (physics-based) multi-level grounds and walls that have been sized and pre-positioned in Blender. Personally, it's hard for me to pretend that it's better to scale/position them in C2 when clearly, external 3D editors are purpose-built for these things -- depending on the game type of course :-)

Many thanks for the previous response, and nice work on the manual -- helps a lot!
Last edited by fuego96 on Sat Dec 31, 2016 2:10 pm, edited 8 times in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Sat Dec 31, 2016 6:05 am

I see you have 2D physics and 8 Directions on some object, you should remove both of these and use "Q3D Oimo Physics", then implement the control logic with events. This is the only way Q3D supports any kind of understanding of 3D forces.[/quote]

Thanks that fix my issue.
B
6
S
2
Posts: 2
Reputation: 456

Post » Sun Jan 01, 2017 9:50 pm

If you're wondering why your Q3D app isn't displaying properly on your smartphone (LG V10 in my case), try setting "Use high-DPI display" to "No".
Image

Also, don't use Chrome Beta for Android, touch controls are buggy for some strange reason.

Now I can check Q3D performance on my smartphone (actual screenshot here).
Image

Feel free to post your phone's make/model and how many FPS you had.
https://www.scirra.com/arcade/other-games/q3d-the-baked-room-scene-with-mobile-controls-13979

LG V10
Fullscreen = 43-46fps
Non fullscreen = 53-60fps
(lowest-highest fps)

EDIT: Hmm... performance seem to vary according to the device's power management, such as when you drive around for 5 minutes and the smartphone start to heat up, thereby reducing thermal margin and the PM throttle's down the CPU/GPU. It's better when deployed as an Android (.apk) app.

On the first try with Android OS 4+ (Lolliepop) (Webview), the app ran at 60fps like the Chrome browser app but running entirely in fullscreen with very little heat dissipation for more than 10 minutes. About 30 minutes later and it got only fairly-hot but not as extreme as when it was running in the actual Chrome browser app, however the FPS remained at 60FPS. After quitting and re-launching a few more test builds, it never went back to 60FPS (just around 39-45FPS). Strange.

EDIT2: Found the main culprit that downgraded the speed. Now the .apk works PERFECTLY like I initially experienced. And the culprit in Intel XDK was this setting.
Image

Just uncheck it. The app will still run in fullscreen anyway -- but way faster (screenshot below).
Image

Feasibility test complete.
Last edited by fuego96 on Thu Feb 09, 2017 4:20 am, edited 2 times in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Tue Jan 03, 2017 9:36 pm

Has anyone been able to successfully texture a Q3DModel with the Paster plugin? I'm looking to dynamically write text on a model (loading the player's nickname at runtime, then pasting their nickname onto a model). I've tried the following so far, none of which work:

Q3DModel -> Set Diffuse Map texture to Paster.imageURL (does not load the texture)

and

Q3DMaster -> *** TEXTURES / CREATE Create texture "nickname" using image file Paster.imageURL
Q3DModel -> Set Diffuse Map texture to "nickname" (gives an error stating that the image file has not been loaded yet or does not exist at all)


I've been able to successfully texture a Q3DSprite this way:

Q3DSprite -> Load image from Paster.imageUrl (Resize to image size).
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
21
Posts: 377
Reputation: 15,092

Post » Tue Jan 03, 2017 9:49 pm

fuego96 wrote:
cjbruce wrote:...Does anyone have a quick and easy way to map 3D space to the 2D screen so that I can label the players?

Here's what I am looking to do:

Image


@cjbruce Q3D has a V-2.2 example called "Position & Rotation actions.capx" which should serve your needs.
https://dl.dropboxusercontent.com/u/82947809/Q3D_Release_Examples/Q3D_V_2_2_Examples.zip

Image


Thanks for the link! I've been through the examples, and don't see how this helps. I've tried all of the expressions and haven't been able to find any expressions that map 3D screen space (x,y,z, with a perspective camera) to the 2D screen (x,y in flat screen space).

I suspect that there is a linear algebra transformation that I'm not thinking of that will do the trick, but I can't seem to get anything to work.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
21
Posts: 377
Reputation: 15,092

Post » Tue Jan 03, 2017 11:37 pm

cjbruce wrote:Thanks for the link! I've been through the examples, and don't see how this helps. I've tried all of the expressions and haven't been able to find any expressions that map 3D screen space (x,y,z, with a perspective camera) to the 2D screen (x,y in flat screen space)....


@cjbruce Ah... I just realized that the example didn't actually return any screen space coordinates. It uses "container" to "pin" the text to the Q3D Model. Sorry, but you're right. Getting the screen coordinates for a Q3D object would be pretty useful indeed. Will let you know if i find anything as well.

EDIT: Correction, the example does return screen space coordinates. Try adding an extra action to the existing example as shown here.
Image

Shows the screen space per Q3DModel by the .xw and .yw properties
Image

The only problem is that, it works if your Q3DMaster camera position is static. You'll have to account/calculate the new screen space manually when the camera moves, which I guess you're probably already aware of :-)
Last edited by fuego96 on Thu Feb 09, 2017 4:20 am, edited 1 time in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests