3D Platform in Hopscotch — Topic

ae_was_here

#57

Makes sense and sounds like a reasonable compromise

But this part still requires O(n) for n layers, right?


#58

The new block in Hopscotch Beta (set width/height) will make 3D rendering a lot easier. I might even be able to do it now lol.


#59

That sounds good! I probably couldn’t do it even if you gave me 500 trillion years.


#60

If we gave you just 50 years to focus on it, there would be no way you couldn’t get it. You have all of the resources needed to figure it out.


#61

oh well


#62

@CreationsOfaNoob FPS is looking pretty good (but is also device dependent of course)

With 216 polygons (rendered using 432 triangle objects) the FPS starts in the high 40s before the device starts heating up. And returns to 60 when the display isn’t be changed.

image


Is it possible to make a 3D platformer in hopscotch?
#63

My iPad Air must be getting really old, only ran at 15 fps and took a couple minutes to setup all the triangles


#64

That looks awesome!
You could cut the object count almost in half for it though, by creating one large black cube behind the colored squares instead of one square behind each.

Also, I believe the blue and green faces should be on opposing sides, same for orange-red and white-yellow.


#65

@paran0id
It loads & runs slowly (~25fps) on an iPad Air 2 that I have as well. The rates noted above were with an iPhone 8.

The loading time can be significantly improved by setting up clones in parallel, however initially I coded it serially to make it easier to work out the algorithm for iterating through all the surfaces.

@CreationsOfaNoob
I used 9 smaller black squares instead of 1 large one to test the FPS. And also because the borders of each individual square will need to rotate with the square when I add the functionality & additional 3D tranformations so the cube actually works. To make it look completely right, even more black squares will be needed for the interior surfaces that can be partially seen as you’re rotating a given row/column.

Those additional surfaces and 3D tranformations will further slow the FPS so I think you’re right, the number of surfaces will need to be optimized. However, to do that I might be able to use a custom image for the right triangle. It’ll have a border only on 1 side so 4 triangles can make the square without lines across its face. Although that may be problematic for the rendering algorithm as I’m not sure if the triangles are always oriented with the same edge on the border. We’ll see.

If that doesn’t work, there’s always more efficient ways to utilize a smaller number to squares, but will add complication.

I’ll fix the colors. Thanks. Didn’t pay much attention when assigning them.


#66

That’s true. I suppose the rotating will be animated?

About the custom image, there might be a problem if the line gets thicker/thinner depending on the set width and height.
You could make 3 different images with a black line on one of the sides each. That way you wouldn’t need to change the rendering algorithm.

Have you thought of adding perspective or are you going to keep it orthographic? It might not make too big of a difference on that scale, but could be nice for realism. Also, it might mess with the hiding of faces that are turned away from the camera.


I’m going to test something here:


#67

It works in a web browser believe it or not but not the app


#68

That’s really cool though. You discovered this, right?


#69

Yes, a few days ago I realized that ThinBuffalo’s 3D rendering worked in web browsers but no the app, even though everyone has the beta version’s webplayer (pushed out December 20th)


#70

@Petrichor @CreationsOfaNoob @ThinBuffalo

It is definitely the beta webplayer in the app, though something in the native app code doesn’t let the project run with the new features


Also,

rip idea of functioning MC in HS


#71

The embedded project is cool. How do you do that?

Yes, I’m planning to animate the row/column rotations. Using different images with different borders is a good idea, if necessary. Although after thinking on it some more, I believe the triangles are always oriented with the hypotenuse requiring the border.

I was planning to retain the orthographic projection. Don’t think perspective is necessary for that specific project. Although I do want to change the rotation control to a virtual trackball if possible.


#72
<iframe width="640" height="480" src="https://c.gethopscotch.com/e/zx1c0jzs6" frameborder="0" allowfullscreen></iframe>

#73

Well, there goes all practical uses of large-scale 3D rendering unless you are on this year’s iPad Pro


#74

Quick question: Does set image work on older projects now? (Try it on my penguin slides project in the beta app with a new object) @CreationsOfaNoob @ThinBuffalo @Petrichor


#75

True, but projects with fewer faces to render can still be impressive & inspirational. Too many “older” Hopscotchers seem to think the language isn’t capable of sophisticated projects, but I tend to think they just lack the education, experience, and/or imagination to understand what’s possible. Let’s change that perception :smile:

Yes, I was able to use the Set Width/Height block on a project created in an older version of the app.


#76

I mean large 1:1 creations like a Minecraft recreation, full scale iPad remake like E-Pad, or something of that matter – that’d run at 4 FPS on the newest devices thanks to the great webplayer performance.

I consider a Rubik’s cube like that still small-medium scale, turning into medium-large scale when turning gets added. @ThinBuffalo

That is why I made Minigames 2 – to greatly reduce objects and maximize efficiency of each one to 1. reduce lag and 2. make a better version of the original.
That is also why MagmaPOP (3% of people will understand what I mean)