HP Forums
LINE_P() and TRIANGLE_P help!! - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: LINE_P() and TRIANGLE_P help!! (/thread-5581.html)



LINE_P() and TRIANGLE_P help!! - alexgt - 01-24-2016 03:48 AM

I have a question about the LINE_P and TRIANGLE_P commands. Both of them have optional advanced syntax, the help hints that it can be used for 3D functions and the such!! I have a hard time understanding the help on it is could someone could show me and give an example, the help is very appreciated Wink


RE: LINE_P() and TRIANGLE_P help!! - cyrille de brébisson - 01-25-2016 07:54 AM

Hello,

Han is the specialist in this domain. He uses the functions extensively in his 3D grapher.

Cyrille


RE: LINE_P() and TRIANGLE_P help!! - Han - 01-25-2016 06:53 PM

Here's a short article that should help you get started for TRIANGLE_P; LINE_P should be very similar.

http://www.hpmuseum.org/forum/thread-5122.html


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 01-26-2016 02:39 AM

Thanks Wink


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 01-26-2016 02:51 PM

Would this be applicable for a game, or even fast enough?


RE: LINE_P() and TRIANGLE_P help!! - cyrille de brébisson - 01-27-2016 05:53 AM

Hello,

It depends what you want to do, how many triangles you have to draw...
It is not slow as Han's 3D drawer shows, but it is not rocket fast either...

Cyrille


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 01-28-2016 07:01 PM

I was thinking for a game I am making in 2D, MinePrime over at Codewalr.us. From the start I wanted to make it 3D but never thought I could, I would have o make th POV really small so I wouldn't have to draw so many. There would probably be < 200 but textures would be impossible xD


RE: LINE_P() and TRIANGLE_P help!! - cyrille de brébisson - 01-29-2016 05:53 AM

hello,

Yep, sorry, at this point in time, triangle only colors, but does not texture.

cyrille


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 01-31-2016 05:17 AM

*uses triangles for every pixel on block

*gets < 0.000000000000001 FPS Tongue


RE: LINE_P() and TRIANGLE_P help!! - StephenG1CMZ - 01-31-2016 03:51 PM

(01-31-2016 05:17 AM)alexgt Wrote:  *uses triangles for every pixel on block

*gets < 0.000000000000001 FPS Tongue

If my maths is right, that is about 1 frame per 32 million years, isn't it?

I think I am going to need some long-life batteries...


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 02-01-2016 02:00 AM

And you will have to be a time lord xD


RE: LINE_P() and TRIANGLE_P help!! - Mark Power - 02-04-2016 11:06 PM

The Prime can do graphics pretty quickly. Have a look at http://www.hpmuseum.org/forum/thread-5628.html


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 02-05-2016 12:12 AM

Wow! Nice Smile

What method did you use for the 3D effect?


RE: LINE_P() and TRIANGLE_P help!! - Mark Power - 02-05-2016 10:58 PM

It's described as Pseudo 3d: parallax scrolling for the background, proper 3d rendering for the road segments and blit the car at the bottom of the screen.

That the Prime can hold png files with transparency within an application structure and blit them to the screen very quickly really helps.

To stop flicker, build up your graphics in say G1 and when complete blit them to G0.

Have a look at this fantastic set of tutorials:

http://codeincomplete.com/posts/2012/6/22/javascript_racer/


RE: LINE_P() and TRIANGLE_P help!! - alexgt - 02-07-2016 06:53 AM

Yeah, I use drawing to G1 then to G0 to solve flicker quite a lot but I was interested in the 3D Tongue