### 3D Flight Simulator - Musical Trade Route

#### ceosol

• Posts: 2196
28 damage inflicted! Did you ever play Rebel Assault? This reminds me a bit of that game. The only thing I'm not sure of is how close the ball is relative to the vanishing point for the shots. It seems like holding the mouse pointer over the ball doesn't always register a hit.

I agree, it would be much better basing hits/misses off of the x,y,z of the target. I had that in my other 3D target practice (http://www.stencyl.com/game/play/30171) prototype. Though, movement in that one is only in the x,y plane and does not include z. The trouble with doing trajectory targeting stems from the pitch angle. If I calculate the bullet trajectory based on enemy actor position, distance of 10 and y of 100 on the screen would be incredibly different from distance of 100 and y of 100. Even though the actor is in the same spot, the x,y,z of the bullets would be incredibly different. Same can be said for the yaw based on actor x screen coordinate. So I would have to create bullet "animation" and trajectory based on pitch and yaw. Doing that would require the initial firing mechanism to recognize how far away the enemy is.

The more I get into those equations, the more necessary having a "target box" for each enemy would be. Target box would have to be a function of distance and speed of the enemy.

#### ceosol

• Posts: 2196
- ship graphic for the enemy
- 5 enemies on screen, each with their own x, y, z
- the enemy's distance from you is displayed
- enemies have 10 hp
- they blow up if you hit them 10 times.

<a href="http://static.stencyl.com/games/33785-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/33785-0.swf</a>

#### merrak

• Posts: 1962
Have you encountered gimbal lock in any of your scenarios?

#### ceosol

• Posts: 2196
I had to look that up, but no I have not seen that in any tests.

#### merrak

• Posts: 1962
In the meantime, I managed to get around it (not gracefully, though). I looked through your equations again and I suspect you haven't run into it because you've broken the computations down into a number of cases.

Quote from: ceosol
Anybody who thinks that Stencyl should automatically have 3D needs to think about these calculations

Definitely  What other surprise might be lurking around the corner?

#### ceosol

• Posts: 2196
It popped into my head today to try adding textures to my 3D prototype. Justin came up with the idea of using matrix transforms that are inherent in drawing. After playing with it a bit, I found a method for creating a wall out of three layered "b-parameter" altered instances. It is not dynamic just yet, and complex textures will be hard to implement. Using the regular matrix, you can only get parallelograms. It would be easiest to do with a rhombus, but I'll take what I can get

The second screenshot is just cut/paste version showing what it could look like after some more fiddling.

#### ceosol

• Posts: 2196
Was just playing around with 3D transforms some more. I hope to get the cube to spin.

• Posts: 2196
Almost there

#### ceosol

• Posts: 2196
Here's a movable one. Still much work to be done

« Last Edit: January 08, 2017, 11:10:54 pm by ceosol »

#### ceosol

• Posts: 2196
I updated the file. I added in 2 more faces. I also put in some programming to tell which faces of the die are shown to you. If the are not, I have them go to the back layer. All I need now is the bottom face.

Right and Left are best for seeing the die. Up and down get all screwy since the bottom face is missing.

EDIT: The bottom face was easier than I thought. It was just the top face shifted down by the z-axis. I think laying is looking pretty good.

[flash ]

« Last Edit: January 11, 2017, 02:37:04 pm by ceosol »

• Posts: 211
thats cool.

#### ceosol

• Posts: 2196
Thanks, I got the rotational axis centered yesterday so it is looking much better. Now I have to figured out how to roll the die and determine which side is up.

#### ceosol

• Posts: 2196
Its not perfect, but I made some rudimentary "rolling". It picks out the random number first and then sets the last spin to show that number. Hit Esc to roll again. You can still use arrow keys to manually move it.

[flash]

« Last Edit: January 13, 2017, 09:41:36 pm by ceosol »

#### ceosol

• Posts: 2196
I had a thought today on how to make a 3D polyhedron. I think it looks pretty good for a first attempt

#### ChristianEs

• Posts: 211
You're going to end up making an actual 3d starfox game wit stencyl

jk but i would love to make one day something like doom 1 on pc with stencyl, i mean isn't that technically posible? since its just a bunch of sprites after all not polygons, maybe with an extension or something.

« Last Edit: January 12, 2017, 03:15:15 pm by ChristianEs »