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

### » Sun Aug 23, 2015 5:12 am

@QuaziGNRLnose, this is so amazing.
It was totally instabuy for me after playing around with the demos.
Thank you for such an amazing and unique plugin.
B
49
S
14
Posts: 111
Reputation: 3,994

### » Tue Sep 01, 2015 1:19 pm

Hey C2 Forums
Been having some trouble trying to get Construct2 and Q3D to figure out the distance between many objects in 3 dimensions and a specific location. Its not the getting the distance of multiple objects that I'm having trouble with. Its that I believe that Q3D doesn't work correctly with the "Distance" Native Expression.

Basically I've got many "enemy" objects moving towards an object in the centre of the game space, lets call it Home. e.g. 5 enemies, spawned 1 second apart from each other and moving slowly towards the Home in the centre. While all the objects are in 3D space, I'm only using 2 dimensions, which is x and y. The objects don't move "up or down"/along the Z, unless they are interacted with by the player but at that point the're positions are no longer needed (the player kills the enemies).

Every tick I'm checking each enemies X and Y and comparing its distance from Home. e.g. "Distance (self.X, self.y, Home.X, Home.Y)", setting that value it to a variable called MyDistanceFromHome. I'll then check each instance to see if its number is less than the others and assign the one with the lowest to be set to the closest object.

The Problem is, I think Construct 2 measuring it in Canvas space rather than 3D Q3D space. So its checking its distance like its a normal 2D Construct 2 game and not a Q3D one.
One fix I thought of was using Ray's, one for each enemy, to measure the distance from Home. When an enemy is spawned, a ray is spawned with it, its told to cast it too the Home's location From the allocated enemy. Then I would measure its length, compare it to the others, if it was the smallest it would be considered the closest enemy. However nothing I've tried to get the rays to interact with the game as worked. I can't seem to spawn one per object, And I can't even seem to make one visible, even with the debug options on.

Help with either the problem or with how to use Rays in Q3D would be greatly appreciated.
B
3
Posts: 5
Reputation: 190

### » Tue Sep 01, 2015 11:01 pm

s3rg385 wrote:
The tweak is I rotate the camera in Q3DMaster by (90,90,0) to have this "First Person View". It work fine, moving and jumping are OK but I can move through walls. Floor is "solid" and I can't pass through it, but walls are like... Nothing. I think it's because I had to change gravity vector, but I can't find (ATM ) a solution. Still working...
And the game is "reverted"...

I'll continue to work on it, you can follow my steps on Instagram : jcharpentier85

are you using some object to stay on floor? what is your Y coordinate based on? ( having that camera angle means u use Y as height X as vertical Z as horizontal )

i mean what keeps ur camera standing? it cant stand by itself unless u wont alter the height of it... so that means if u dont have no object to interact or have the camera as in a FPS where u have a model behind it... when ul hit a wall having a object /model/smth there will stop the camera go trough... not having it... well camera its not a physical object.. cant be stopped by walls..

OFF : some random funny q3d stuff < nodewebkit gameplay
<capx
B
82
S
24
G
69
Posts: 1,362
Reputation: 44,214

### » Wed Sep 02, 2015 6:54 am

Is there a way I can "draw" on an object? I want bullets when impacting the level to leave marks. However instead of leaving a decal on the wall I would like to draw the decal on it permanently. This way they won't fade.
B
18
S
5
Posts: 57
Reputation: 1,167

### » Wed Sep 02, 2015 8:48 am

Sir LoLz wrote:Is there a way I can "draw" on an object? I want bullets when impacting the level to leave marks. However instead of leaving a decal on the wall I would like to draw the decal on it permanently. This way they won't fade.

you mean as a bullet hole? why not just spawn it on the impact? and leave it there for as long as you want, however having to many of those bullet holes may drop FPS in future gameplay so you may want that the decals to be destroyed or to fade out after some of them pile in numbers
B
82
S
24
G
69
Posts: 1,362
Reputation: 44,214

### » Wed Sep 02, 2015 3:54 pm

@Rhed

as long as you're feeding in x/y coordinates that are from Q3D, the distance values you get should be right and in the right coordinate system, although you must realize it's only the planar distance between objects, not accounting for Z. To get 3D distance you must use the Pythagorean theorem extended to 3D, distance=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

### » Thu Sep 03, 2015 5:50 am

@QuaziGNRLnose, I am having couple of issues if you can help -

1. I have multiple layouts and using Q3Dmaster in one of the layout. When I navigate to the layout having the Q3DMaster and then back to any other layout that has buttons/listboxes, then the buttons/listboxes in other layouts disappear irrespective of whatever layer they are present on..I am using the "Behind" mode of Q3DMaster.

2. When I use the "Inside" mode, then the listboxes/buttons on the other layouts show up in the above scenario...However inside mode renders everything upside down...

Any help is appreciated.
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

### » Thu Sep 03, 2015 6:01 am

however having to many of those bullet holes may drop FPS in future gamepla

That is why I would like to draw them to the object's texture directly. I'm hoping to make a system that finds xyz cords and then pastes a sprite unto the objects texture at those cords.
B
18
S
5
Posts: 57
Reputation: 1,167

### » Thu Sep 03, 2015 12:38 pm

@QuaziGNRLnose
Thanks for the reply, I'll give it a closer look thanks.
I don't need to get their distance in 3D for the game to function as intended. but I'll definitely try it out, might fix or improve the game altogether.
I have thought that maybe the reason why the closest object to Home was because the camera was making objects appear to be further away than they are. But Now I've got a life system In place, that doesn't seems to be the case, as objects that look like the closest, but are not being recognised as the closest are colliding with Home correctly and causing the player to lose a life, meaning that it was definitely the closest.
Is there something wrong with the way I'm using the "Distance" expression? I noticed that there's allot of different options for obtaining the x/y/z coordinates for a Q3DModel object e.g. Sx,Sy, Sz or nBx. Should I be using these? What's the difference between each of these? My guess its to do with mathematics but I'm not proficient in this kind of maths.
Either way I'll revisit the distance gathering logic and see if theres something else that's causing it.
B
3
Posts: 5
Reputation: 190

### » Sat Sep 05, 2015 3:28 am

After reading the 140 pages I can say Q3D is a must have! Thanks to davioware team!!
B
15
S
5
Posts: 40
Reputation: 1,221

PreviousNext