3D Rendering Discussion

Fellows, I’m working with some 3D code and have arrived at a small nuisance of which my coding capacity cannot handle.

The question is the following; when the project is scrolled through, and after the appropriate distance and trigonometric angles are calculated using the vector created from when the iPad was touched and when released, the trails will then move appropriately. But the problem is that it takes an entire frame (or more) for it to move a little, and then in the entire next frame it clears. This means that it is flashing. When (if) I develop some game out of this, it would be difficult and rather frustrating to have flashing trails.

So I was thinking that if I could compress the clear and the draw all into one frame, where in that case the flashing could be potentially unnoticeable. It would be handy to know that the project is working at 62 FPS. However as the content accumulates, this may no longer be the case)

Not sure how to do this. If someone could explain, that would be neat. You don’t need to explain using 3D, because this issue concerns dynamic trail art rather than 3D.

——————————————

(Also, does anyone have any good websites/videos on 3D? Any programming language/version will do. Preferably Scratch or unity because they closely resemble hopscotch)

18 Likes

You mean moving trail art like Valgo?

6 Likes

Well if it is MTA you’re talking about I might be able to help.

When Game is playing

Clear

When Game is playing

Set position to whatever the initial position of the trail you want to draw is

When Game is playing

Draw a trail

Set position to the last position of the trail

I might make a YT tutorial on it later

5 Likes

Well, you could say that I guess

3 Likes

Game is playing?

4 Likes

Aka 7 = 7
it’s a new block

2 Likes

have you tried putting the clear and draw a trail in different rules?

3 Likes

Ah, I’m so ancient I never knew it existed.

The clear would go first right?

5 Likes

Yes. Otherwise it would be blank

2 Likes

Yeah I did that. Order may have been wrong

3 Likes

here’s the code
4 Likes

Oh hai peeps

4 Likes

maybe put a wait 0 before the clear? wait no that would mean a 1 frame delay

4 Likes

Thanks for your help, it’s looking better.
Also, do any of you have any good websites or links for 3D?

4 Likes

Uhh not really…
I’ve done it before but with TONS of help from my Dad and I don’t remember much.
There’s a lot of Sine/cosine involved. I remember something about a tilted circle but I don’t remember how to do it. You should ask @CreationsOfaNoob if you want help.

4 Likes

Yeah there’s lots of trig, but it’s not too bad. I don’t really need help as such, all I need is just a bunch of websites and links so that I can get a full on tutorial and guidance

3 Likes

No I don’t. :|
Maybe look it up?

3 Likes

Most of what comes up on the first page is rather abstract

5 Likes

You have to use clones or separate objects since each instance can only execute one draw action per frame, as far as I know.

Basically, on the same frame, the first editor object (and original object) clears every frame so that the clear happens first, and everything else draws later on that same frame.

6 Likes

Maybe this will help? https://www.sitepoint.com/building-3d-engine-javascript/

3 Likes