Re: [fpc-pascal] Working on a new way to educate people about pascal
I’ve found firebase to be one of the easiest databases to wrap my mind around. https://firebase.google.com https://blogs.embarcadero.com/quick-and-easy-way-to-integrate-firebase-into-your-delphi-apps/ Thomas Young Sent from my iPhone > On Dec 29, 2022, at 12:16 AM, Anthony Walter via fpc-pascal > wrote: > > > I think most people can quickly figure out that SQL is a programming language > that is used to manage data stored in relational databases. It is a > relatively easy language to learn and use, especially for people with a basic > understanding of programming concepts. It's a widely-used language in the > field of data management and is based on simple, English-like commands. SQL > uses a straightforward syntax that is easy to understand and learn. Many > people find it to be a user-friendly language, and it is often used as an > introduction to programming for people who are new to the field. It shouldn't > be confusing to anyone who has been programming for decades. > > The line of code you provided is a SELECT statement that retrieves all rows > (indicated by the * symbol) from a table called "Customers." The statement > also includes a WHERE clause, which specifies a condition that must be met in > order for the rows to be included in the results. In this case, the condition > is that the value in the "Country" column must be equal to 'USA'. Therefore, > this line of code would retrieve all rows from the "Customers" table where > the value in the "Country" column is 'USA'. The results of this SELECT > statement would include all of the columns from the "Customers" table for > each row that meets the specified condition. > > I agree, deciphering your statement ought to be quite clear to anyone with > even a passing curiosity, which is why I was unsure earlier how anyone on > this mailing list was confused by SQL. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Hello, new Pascal programmer. had a question!
> On Aug 27, 2021, at 4:01 PM, joseph turco via fpc-pascal > wrote: > > I am a new programmer, and I thought I'd learn Pascal. Good day Joseph, Pascal is the language I was taught in 1986. I’m still using it. First question to ask yourself is why and what do you need to program? For myself, I use Pascal for automation, file I/O, parsing text and data, mathematical explorations and 2D/3D graphics. Regards, Thomas Young___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates
James, are you not applying the rotation universally to all coordinates? If so, you are better off pre-calculating your directional sines and cosines. For example: TH: REAL; {ROTATIONS (in degrees) AROUND Z-AXIS BY theta, LEFTRIGHT-> turn its back to us} PHI: REAL; {ROTATIONS (in degrees) AROUND X-AXIS BY phi, UPDOWN-> a nod} PSI: REAL; {ROTATIONS (in degrees) AROUND Y-AXIS BY psi, SPIN-> a clock face} P STH: REAL;{SIN(TH * (PI / 180)), CONVERT DEGREES TO RADIANS} CTH: REAL;{COS(TH * (PI / 180)), CONVERT DEGREES TO RADIANS} STI: REAL;{SIN(PHI * (PI / 180)), CONVERT DEGREES TO RADIANS} CTI: REAL;{COS(PHI * (PI / 180)), CONVERT DEGREES TO RADIANS} STS: REAL;{SIN(PSI * (PI / 180)), CONVERT DEGREES TO RADIANS} CTS: REAL;{COS(PSI * (PI / 180)), CONVERT DEGREES TO RADIANS} Thomas Young 330-256-7064 Sent from my iPhone > On Sep 19, 2019, at 12:38 PM, James Richters > wrote: > > Thank you for the help and suggestions with this. After playing with the > suggested formulas I was able to figure out how they work... The solution to > this is probably somewhere but I ended up just doing it myself. > > I realized that Thomas' formula > var H1 = (Y - X) * 0.86602 + ScreenOrgin_H; var V1 = (X + Y) * 0.5 - Z + > ScreenOrgin_V; > was multipying by the cosine of 30 degrees for H1 and the Sine of 30 degrees > for V1 > > and Gustavo's forumla was basically the same thing but multiplying by the > cosine and sine of 45 degrees... > > so I realized that all I really want to do has nothing to do with camera > angles, or projections or anythng else... I just strictly need do the 3D > rotations then just display the resulting X, and Y coordinate and ignore Z. > My original 2D representaion showing only X and Y is as if I am looking > perfectly straight down at it.. so I can't see the Z only lines, but after I > perform the 3D rotations now I can see the Z component as they end up being > represented on the X and Y axis but I still act like I am still looking > straight down at it, so I only plot X and Y. > I checked the results of my formula against my CAD program everything looks > EXACTLY the same no matter how I change the rotations, so this must be what > the CAD program is doing as well. > > Here are the formula I came up with that allows me to adjust the 3 possible > rotations, A - rotating around the X axis, B rotating around the Y axis, and > C rotating around the Z axis. > > X1 - initial X coordinate > Y1 - initial Y coordinate > Z1 - initial Z coordinate > X2 - output X coordinate > Y2 - output Y coordinate > > //XY Rotation - only rotates X and Y around the Z axis (C Rotation) > XC_Point := ((CoSine(C_Angle) * (X1-XC_Center)) - (Sine(C_Angle) * > (Y1-YC_Center) )) + XC_Center; > YC_Point := ((CoSine(C_Angle) * (Y1-YC_Center)) + (Sine(C_Angle) * > (X1-XC_Center) )) + YC_Center; > ZC_Point :=Z1; > > //XZ Rotation - only rotates X and Z around the Y axis (B Rotation) > XB_Point := ((CoSine(B_Angle) * (XC_Point-XB_Center)) + (Sine(B_Angle) * > (ZC_Point-ZB_Center) )) + XB_Center; > YB_Point := YC_Point; > ZB_Point := ((CoSine(B_Angle) * (ZC_Point-ZB_Center)) - (Sine(B_Angle) * > (XC_Point-XB_Center) )) + ZB_Center; > > //YZ Rotation - only rotates Y and Z around the X axis (A Rotation) > XA_Point := XB_Point; > YA_Point := ((CoSine(A_Angle) * (YB_Point-YA_Center)) - (Sine(A_Angle) * > (ZB_Point-ZA_Center) )) +@YA_Center; > ZA_Point := ((CoSine(A_Angle) * (XB_Point-XA_Center)) + (Sine(A_Angle) * > (ZB_Point-ZA_Center) )) + XA_Center; // useless to plot point, just for > information > > X2 := Scale * XA_Point+X_Offset; > Y2 := Scale * YA_Point+Y_Offset; > > Notes: > > My fuctions CoSine and Sine convert the angle to radians from given degrees. > > I have my 0,0 located in the lower left hand corner, but PTC-Graph has it in > the upper left corner.. I used the above formula before the section that > takes care of getting it on the screen, I don't know if some adjustment would > be nessecary for use on direct screen coordinates... things might end up > upside down, or the rotations might need to be reversed by switching the + > and - between CoSine and Sine because of this.. > > > Thank you again for all the help and suggestions. I also found the websites > and books on the subject very interesting as well. > > James > > > -Original Message- > From: fpc-pascal On Behalf Of > Thomas Young via fpc-pascal > Sent: Tuesday, September 17, 2019 5:00 PM > To: FPC-Pascal users discussions > Cc: Thomas Young > Subject: Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates > > This is an isometric projection I use: > var H1 = (Y - X) * 0.8660
Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates
This is an isometric projection I use: var H1 = (Y - X) * 0.86602 + ScreenOrgin_H; var V1 = (X + Y) * 0.5 - Z + ScreenOrgin_V; Thomas Young 330-256-7064 Sent from my iPhone > On Sep 17, 2019, at 4:53 PM, Gustavo Enrique Jimenez > wrote: > > A simple transformation is: > > P3D=(X,Y,Z) > P2D=(x,y) > > x=X+Y*0.707 > y=Y*0.707+Z > > I did not tried it, but I think that this is the transformation that > you are looking for. > > > Gustavo > > El mar., 17 sept. 2019 a las 17:37, James Richters > () escribió: >> >>> What exactly are you trying to do? Usually if you’re doing 3D this all >>> happens on the GPU and you get back a color/depth buffer. Maybe you need to >>> know where a 2D coordinate is in 3D space? >> >> What I'm trying to do is much simpler than rendering a 3D object.. All I'm >> trying to do is display a 3D line drawing or wireframe on the screen. I >> don't need it to dynamically rotate or anything, and it doesn't need to show >> any surfaces, textures, lighting, reflections, or shadows, just give a >> representation of the XYZ points and lines connecting 2 pair of XYZ >> coordinates on the screen. The purpose of this is to show a 3D >> representation of a CNC tool path including the Z movements. >> >> James >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Talkback and detecting touch events
Hi, Years ago I had a career as a technical illustrator. First analog then digital. Perhaps the following code I developed back around 1992 might be helpful to you. H = Horizontal coordinate on picture plane. V = Vertical coordinate on picture plane. XYZ = 3D coordinate. distance = "camera" distance from the model: a range of values [0..15000] (logrithmic). height = "camera" height from 0 ground plane. H := scale * (X * distance / (Y + distance)) + H_offset; V := scale * ((Z - height) * D / (Y + distance)) + Y_offset; Thomas Young 330-256-7064 Sent from my iPhone > On Sep 17, 2019, at 11:20 AM, Mgr. Janusz Chmiel > wrote: > > Please would somebody of us try to tell Me, if Android API functions can > detect how many fingers have been used to touch The display even while > Talkback screen reader work ane Explore by touch service is communicating > with display? > I do not want to use graphical mode, since it require that Talkback screen > reader must be turned off. One developer, who have used Java language used > some technique, which could detect how many fingers have been used to shift > from down to up. If one or two. Thank you very much for yours tips how to > detect this specific touch events when Talkback is running. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal