The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

HP Prime Programming Help

Started by alexgt, January 24, 2016, 03:55:24 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alexgt

January 24, 2016, 03:55:24 am Last Edit: January 24, 2016, 03:57:00 am by alexgt
This is a cross post from HP Museum:
QuoteI 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 ;)

So basicly I think there is already built in 3D functions for LINE_P() and TRIANGLE_P() O.O *.* O.O
(3D MinePrime here I come!!!)
It would be nice if @timwessman shed some light on the topic ;)

This is my first question here but feel free to post your own troubles ;)

DJ Omnimaga

Well, TRIANGLE_P has been around for a while already and is indeed a 3D command. There are probably some instructions somewhere, but of course to do proper 3D models you would need 3D knowledge and perhaps a way to convert blender models to calc. LINE_P got some 3D capabilities a while ago too but I assume it's for wireframe 3D. And there's also the FILLPOLY_P command which lets you draw a single polygon with an opacity level of your choice (and using a fullscreen polygon even lets you do fade-in/out animations.

The syntax for FILLPOLY_P is something like this:

FILLPOLY_P(G3,{{0,0},{320,0},{320,0},{320,0}}, #000000, 128);

TRIANGLE lets you draw multiple polygons (with some gradient IIRC) in one go, but it lacks opacity support.

alexgt

Triangles have opacity now, and the help section on LINE_P and TRIANGLE_P expanded quite a lot, so the functions were probably there they just didn't show up in the help section. I could learn how to do it if I could find a example program somewhere though...

DJ Omnimaga

Wait they do? O.O I didn't know that. Imagine how fast the 3D grapher app would be now. The author used TRIANGLE back when it lacked opacity and it ran fast, but then switched to FILLPOLY, which looked nicer, but the frame rate dropped since he needed to draw each polygon one by one.

What I am curious about is how does the triangle format compares to Blender format and stuff like that? That said, even if you got an actual 3D model to show up, it would just be a single color (or with a gradient), so TRIANGLE would be more suitable for simple objects such as a spaceship. FILLPOLY would probably be quite slow and polygon sorting done manually would be hard to implement (and even slower)

What I would be more interested in is if mode-7 would be fast enough in HP PPL.

alexgt


SiphonicSugar

I'm just trying to grab some inspiration. :P

alexgt

So here is a link that Hans @ hp museum gave me which help a lot.
http://www.hpmuseum.org/forum/thread-5122.html

DJ Omnimaga

Awesome. Speed-wise I think it should be fine, but it depends how many 3D models you need to draw.

alexgt

I was thinking 3D MinePrime soo probably 100+ triangles :P

DJ Omnimaga

Wait @alexgt , are you planning to make Mineprime in 3D? Because that might be quite hard because of all blocks being individual blocks rather than just one big map model. It might be better to experiment with smaller stuff first (and finish Mineprime 2D) :P

Something I always wondered is if it's possible to display one massive polygon using FILLPOLY and still not have speed issues? Because then that could be a cheap way to get something that ressembles mode 7 (if you managed to make a GROB to polygon model converter, that is, which would probably be hard) and you could probably use multiple polygon models superposed on each others (since FILLPOLY only allows 1 color at a time) so it would look like a mode 7 map.

It might be worth it to attempt mode 7 without FILLPOLY, though, in case that is fast enough.

alexgt

I don't really understand what mode 7 is :P

I will hopefully make a 3D MinePrine game in the future but nothing near as extensive as Crafti, it would be more of a proof of concept

Powered by EzPortal