|
Post by (X) on Jan 27, 2024 2:18:48 GMT 1
Sometimes, I just follow my nose. This morning, I wanted to see how far I could get while trying to emulate one of my favourite arcade games from many years ago: BATTLEZONE 1980. Little did I know how much trouble I'd get into as I followed to apetizing smell of a freshly baked pie.
Here is a teaser of my GB32 code so far.
Source code: (just getting started)
Here is a link to some "game play", essentially, this is what I am aiming for...
|
|
|
Post by (X) on Jan 29, 2024 4:04:16 GMT 1
It's going so well!
So... What do we have here? A 3D editor for wireframe games objects? You betcha!
Notice how the color scheme intuitively follows the logic of combining the xyz axis color: {red, green, blue} for each plane: {xy:RG = yellow, xz:RB = magenta, yz:GB = cyan and xyz:RGB = white}.
YouTube video:
As mentioned this is pure exploration and adventurous coding so this base code may change a lot in future versions. You are free to examine and use this code for educational purposes.
|
|
|
Post by scalion on Jan 29, 2024 9:28:33 GMT 1
Que de bons souvenirs ! Si tu veux te créer des objets 3D filaires, je te conseille d'aller sur www.tinkercad.com/L'interface est super intuitive et tu peux exporter tes créations au format STL ou OBJ. Très pratique !
|
|
|
Post by (X) on Jan 29, 2024 11:54:43 GMT 1
Que de bons souvenirs ! Si tu veux te créer des objets 3D filaires, je te conseille d'aller sur www.tinkercad.com/L'interface est super intuitive et tu peux exporter tes créations au format STL ou OBJ. Très pratique ! Tinkercad? J'y vais tout de suite... Quelques moment plustard... Merci pour l'info. Tinkercad est excellent! Ça va surement servir! C'est un bon but d'arriver à ce niveau de fonctionalité avec un modeleur 3D GB32.
Tu me connais, je vais esseyer de tout faire en GB32 pour exercise et divertissement.
Tinkercad? I'll check this out right away... A few moments later... Thanks for the info. Tinkercad is excellent! It's sure to come in handy! It's a good goal to achieve this level of functionality with a GB32 3D modeler.
You know me, I'll try to do everything in GB32 for exercise and entertainment.
|
|
|
Post by scalion on Jan 29, 2024 12:12:27 GMT 1
Que de bons souvenirs ! Si tu veux te créer des objets 3D filaires, je te conseille d'aller sur www.tinkercad.com/L'interface est super intuitive et tu peux exporter tes créations au format STL ou OBJ. Très pratique ! Tinkercad? J'y vais tout de suite... Quelques moment plustard... Merci pour l'info. Tinkercad est excellent! Ça va surement servir! C'est un bon but d'arriver à ce niveau de fonctionalité avec un modeleur 3D GB32.
Tu me connais, je vais esseyer de tout faire en GB32 pour exercise et divertissement.
Tinkercad? I'll check this out right away... A few moments later... Thanks for the info. Tinkercad is excellent! It's sure to come in handy! It's a good goal to achieve this level of functionality with a GB32 3D modeler.
You know me, I'll try to do everything in GB32 for exercise and entertainment.
Pareil pour moi, je peux pas m'empêcher par pure gymnastique intellectuelle.
|
|
|
Post by (X) on Jan 29, 2024 12:36:24 GMT 1
Things are going better than a Denebian slim worm at a theme parc water slide!
Oh lala!
Ça commence!
|
|
|
Post by (X) on Feb 1, 2024 18:43:54 GMT 1
J'apprends comment importer des fichers STL. J'ai développé une petite librarie: "Lib_STL_Import"
Je vais tout afficher bientôt.
I'm learning how to import STL files. I've developed a little library: "Lib_STL_Import". I'll post it soon.
Proc LIB_STL_IMPORT_NOTES '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' From: BING. ' ' An STL (Stereolithography) file is a widely used data format for 3D graphics, ' particularly in the field of 3D printing and computer-aided manufacturing. ' Here’s a breakdown of its structure: ' ' Unit Normal and vertices: An STL file describes a raw, unstructured ' triangulated surface. Each triangle is defined by the unit normal and v ' (ordered by the right-hand rule) of the triangles using a three-dimensional ' Cartesian coordinate system. Each facet is uniquely identified by a unit ' normal (a line perpendicular to the triangle and with a length of 1.0) and ' by three vertices (corners). ' ' No Scale Information: STL files contain no scale information, and the units ' are arbitrary. ' ' Surface Geometry Only: STL files describe only the surface geometry of a ' three-dimensional object without any representation of color, texture, or ' other common CAD model attributes. ' ' ASCII and Binary Representations: The STL format specifies both ASCII and ' binary representations. Binary files are more common, as they are more ' compact. ' EndProc
|
|
|
Post by (X) on Feb 2, 2024 3:12:50 GMT 1
I am getting more sensible results in the edit view...
J'obtiens des résultats plus raisonnables dans la vue d'édition...
Ich erhalte vernünftigere Ergebnisse in der Bearbeitungsansicht...
I might be impessed with my coding skills... But, Darth reminded me (correctly, I might add) that I am not a "Jedi" yet!
Je pourrais être impressionné par mes compétences en matière de codage... Mais Darth Vader m'a rappelé (à juste titre d'ailleurs) que je ne suis pas encore un "Jedi" !
Ich könnte von meinen Programmierfähigkeiten besessen sein... Aber Darth hat mich daran erinnert (zu Recht, wie ich hinzufügen möchte), dass ich noch kein "Jedi" bin!
|
|
|
Post by (X) on Feb 3, 2024 4:15:44 GMT 1
Je fais quelques progrès. I am making some progress.
Ich mache einige Fortschritte.
Je ne suis pas tout à fait prête à postuler à un emploi chez ILM, mais je vois une petite lumière au bout du tunnel.
I am not quite ready to apply for work at ILM but I can see a tiny light at the end of the tunnel. Ich bin noch nicht so weit, mich bei ILM zu bewerben, aber ich sehe ein kleines Licht am Ende des Tunnels.
Je vous assure, Seigneur Vador, que je travaille aussi vite que possible. I assure you, Lord Vader, I am working as fast I can. Ich versichere Ihnen, Lord Vader, ich arbeite so schnell ich kann.
Vous pourrez peut-être le dire à l'empereur lorsqu'il arrivera... L'Empereur vient ici ? Je vais redoubler d'efforts !
Perhaps you can tell that to the Emperor when he arrives... The Emperor is coming here? I shall redouble my efforts! Vielleicht kannst du das dem Kaiser sagen, wenn er kommt... Der Kaiser kommt hierher? Ich werde meine Bemühungen verdoppeln!
|
|
|
Post by (X) on Feb 4, 2024 20:51:52 GMT 1
The Emperor demands constant updates!
BZ UPDATE #1:
I managed to implement Isometric, Orthogonal and Perspective view of the 3D model under edit. (Ctrl-RightMouseClick toggles in and out of edit mode, likely just a temporary measure.) I got a few blinking alerts and a few more titles... Still many more changes to come I am sure.
Source Code for the curious...
|
|
|
Post by Roger Cabo on Feb 5, 2024 19:19:45 GMT 1
well made.. 👍
|
|
|
Post by (X) on Feb 6, 2024 15:36:17 GMT 1
The intrepid coder is working hard to bring a fully operational BATTLEZONE training module to reality. BZ UPDATE #2 We can now see the mountain ranges and travel around - even outside the perimeter - something I think will be disabled in the "real" game. Perhaps an opportunity for an "Easter Egg"?.
I've also added a few features not included in the original game: a heading readout in degrees and a cartesian position as distance from the center of what I imagine is a large crater given the ominous title of "Battle Zone". You can view the latest 1 min video at:
|
|
|
Post by Roger Cabo on Feb 6, 2024 22:46:13 GMT 1
There are some interesting option possible:
* don't draw hidden lines * solid tanks * wireframe color * sounds and Musik * high score * player level * enemy level
😇
|
|
|
Post by (X) on Feb 7, 2024 3:36:48 GMT 1
Well, a picture is worth a thousand words. I think you know what's going on....
Update #3 Added map location showing the tank location and orientation.
Got editor perpective to work with turning the camera about the center using left and right keys. Put the options on it's own configuration form to stop it interfering with key presses meant to move the camera in perspective and ortho edit mode.
BATTLEZONE V3.G32 (55.77 KB)
|
|
|
Post by (X) on Feb 7, 2024 22:46:55 GMT 1
There no better encouragement than having your boss constantly looking over your shoulder! Such a pleasure!
Update #4... ' UPDATED 2024-02-07 Swerved a divide by 0 error. Implemented multiple key ' detection so you can move forward or backward while turning left ' or right. Centered the map to the bottom of the screen. Adjusted ' the radar line thicknesses and added a circle border. ' Added a small moon (That's no moon... It's a space station!) BATTLEZONE V4.G32 (59.37 KB)
|
|
|
Post by larrybtoys on Feb 7, 2024 23:48:02 GMT 1
Is my constant writing of PC games rubbing off on you?
|
|
|
Post by (X) on Feb 8, 2024 2:41:11 GMT 1
Is my constant writing of PC games rubbing off on you?
My best guess is that I arrived at tipping point where I feel confident enough to try out some long standing yearnings to write my own games. But first, as with aspiring artists, you start by copying the greats.
Je pense que j'ai atteint le point de bascule où je me sens suffisamment confiant pour tenter de réaliser un vieux rêve, celui d'écrire mes propres jeux. Mais d'abord, comme pour les artistes en herbe, il faut commencer par copier les plus grands.
Ich glaube, ich bin an einem Punkt angelangt, an dem ich mich selbstbewusst genug fühle, um den lang gehegten Wunsch, meine eigenen Spiele zu schreiben, in die Tat umzusetzen. Aber wie bei allen angehenden Künstlern beginnt man damit, die Großen zu kopieren.
|
|
|
Post by (X) on Feb 9, 2024 2:47:16 GMT 1
It was the best of times. It was the worst of times. Guess which time this is?
Update #5 ' UPDATED 2024-02-08 Trying to implement conversion functions for the ' various coordinate systems. Trying to implement a tilted moon ' orbit. Small changes to the graphical layout. Adjusted mountain ' range. No pics. No videos. No source code. Too many things to fix!
|
|
|
Post by (X) on Feb 12, 2024 10:43:25 GMT 1
Update #6
' UPDATED 2024-02-11 Deep into the matrix weeds... No source code. No images. No video. Gotta get this sorted and working first.
|
|
|
Post by (X) on Feb 13, 2024 13:05:12 GMT 1
|
|
|
Post by (X) on Feb 16, 2024 20:25:55 GMT 1
Learning how to save 3D Object data points to a Hash Table...
|
|
|
Post by (X) on Feb 23, 2024 23:02:26 GMT 1
BING's impression of a "Render Pipeline"
I finally got BING to spit out some reasonable code suggestions...
$Group "RENDER PIPELINE" Sub TransformLocalToWorldSpace(ByVal vertex As Vertex) ' Code to transform to world space End Sub
Sub TransformWorldToViewSpace(ByVal vertex As Vertex) ' Code to transform to view space End Sub
Sub ProjectViewToClipSpace(ByVal vertex As Vertex) ' Code to project to clip space End Sub
Function ConvertClipToScreenSpace(ByVal vertex As Vertex) As POINT ' Code to convert to screen space ' Returns a 2D point End Function
Sub MainRenderingPipeline(ByVal vertex As Vertex) ' ' Main procedure for the rendering pipeline ' This process is repeated for every vertex in the model. Once all vertices have ' been processed through the pipeline, the resulting 2D screen coordinates can ' be used to draw the model on the screen. This is a fundamental part of 3D ' rendering and is handled efficiently by modern graphics hardware and APIs. ' TransformLocalToWorldSpace(vertex) TransformWorldToViewSpace(vertex) ProjectViewToClipSpace(vertex) Dim screenPoint As POINT = ConvertClipToScreenSpace(vertex) ' Now you can use screenPoint for drawing on the screen ' Please note that this is a simplified example and the actual transformation matrix would ' depend on the specifics of your application. Also, this code doesn't handle homogeneous ' coordinates or perspective division, which are typically part of the 3D transformation process. ' ' Me: Explain "this code doesn't handle homogeneous coordinates or perspective division" ' BING: ' **Homogeneous Coordinates:** ' In 3D computer graphics, homogeneous coordinates are often used in place of Cartesian ' coordinates. Homogeneous coordinates have an extra dimension over Cartesian coordinates, ' typically represented by a 'w' coordinate. In 3D, this means using four coordinates to ' represent a point in space: (x, y, z, w) instead of the usual three (x, y, z)¹². ' The advantage of homogeneous coordinates is that they allow us to represent all geometric ' transformations (like translation, rotation, scaling) as matrix multiplications, which ' simplifies the mathematics and makes computations more efficient¹³. They also allow ' us to represent points at infinity, which are used in perspective projection². ' When we say "this code doesn't handle homogeneous coordinates", it means that the code ' doesn't take into account the 'w' coordinate and doesn't perform operations in homogeneous ' space. ' **Perspective Division:** ' Perspective division is a step in the 3D graphics pipeline that transforms the 4D clip ' space coordinates to 3D normalized device coordinates7. It's done by dividing the x, y, ' and z components of the position vectors by the vector's homogeneous w component7. ' This operation is what gives the perspective effect: objects further away from the camera ' appear smaller on the screen5. It's called "perspective division" because it involves ' dividing by the 'w' coordinate, which after projection contains a factor related to depth5. ' When we say "this code doesn't handle... perspective division", it means that the code ' doesn't perform this division step, and therefore doesn't correctly project 3D points onto ' the 2D screen with perspective. ' I hope this helps! If you have any more questions, feel free to ask. °Source: Conversation with Bing, 2024-02-23 °(1) Computer Graphics Homogeneous Coordinates - GeeksforGeeks. https://www.geeksforgeeks.org/computer-graphics-homogeneous-coordinates/. °(2) Homogeneous coordinates - Wikipedia. https://en.wikipedia.org/wiki/Homogeneous_coordinates. °(3) Why are Homogeneous Coordinates used in Computer Graphics?. https://computergraphics.stackexchange.com/questions/1536/why-are-homogeneous-coordinates-used-in-computer-graphics. °(4) LearnOpenGL - Coordinate Systems. https://learnopengl.com/Getting-started/Coordinate-Systems. °(5) opengl - Why do we need perspective division? - Stack Overflow. https://stackoverflow.com/questions/17269686/why-do-we-need-perspective-division. °(6) 5.6: Three-Dimensional Homogeneous Coordinates. https://eng.libretexts.org/Bookshelves/Electrical_Engineering/Introductory_Electrical_Engineering/A_First_Course_in_Electrical_and_Computer_Engineering_%28Scharf%29/05%3A_Vector_Graphics/5.06%3A_Three-Dimensional_Homogeneous_Coordinates. °(7) Perspective divide: Why use the w component? - Stack Overflow. https://stackoverflow.com/questions/31686664/perspective-divide-why-use-the-w-component. °(8) Perspective division. Perspective division is a key step in… | by .... https://medium.com/@sim30217/perspective-division-99e08de59088. °(9) Perspective Division - Real-Time 3D Graphics with WebGL 2 - Second .... https://www.oreilly.com/library/view/real-time-3d-graphics/9781788629690/df8e69a9-e030-432d-a897-f49f64a8dca8.xhtml. End Sub
All that remains is to fill in the blanks!
|
|
|
Post by larrybtoys on Feb 24, 2024 13:14:35 GMT 1
Looking forward to seeing/playing final!
|
|
|
Post by (X) on Feb 24, 2024 13:47:42 GMT 1
'################################################################################# ' ' DISCLAIMER: THIS CODE IS OFFERED AS IS FOR EDUCATIONAL PURPOSES. ' YOU ARE FREE TO USE, COPY AND DISTRIBUTE. ' THE USE OF THIS CODE IS AT YOUR OWN RISK. ' I ACCEPT NO LIABILITY NOR MAKE ANY CLAIM OF ' CORRECTNESS OR SUITABILITY IN PART OR IN WHOLE. ' '################################################################################# ' ' FILENAME Lib_3D_Model_View.G32 ' ' DESCRIPTION A library to view GB32 generated 3D models. ' ' AUTHOR (X) ' EMAIL xman.gb32@gmail.com ' YOUTUBE https://www.youtube.com/@gfabasic32 ' WEBSITE https://gfabasic32.blogspot.com/ ' FORUM https://gb32.proboards.com/ ' START 2024-02-24 Started laying down the foundation ' UPDATE <ISO date> ' '################################################################################# ' ' NOTES 2024-02-24 ' ' While I was developing a BATTLEZONE 1980 "mashup/simulation" I came to the ' realization that a library is essential to standardizing the viewing code ' required for this program and any other similar program. ' ' I am starting to think that I need one universal method to convert local ' coordinate space to screen coordinate space. ' All I would need to provide is the local coordinates, the camera configuration ' and the destination form/window. All of this mechanism could be burried in a ' "BlackBox" library so as not to clutter the code and to make it much easier ' to apply to a new program. OK (X)... Lets DO this! ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
$Export "Lib_3D_Model_View"
|
|
|
Post by (X) on Feb 24, 2024 13:51:26 GMT 1
Looking forward to seeing/playing final! Me too!
|
|
|
Post by (X) on Feb 25, 2024 2:13:48 GMT 1
Latest update...
Dividing the main program up to hopefully more easily conquer the following phases of the BATTLEZONE saga. I have the 3D functions and procedures sequestered in their own lib: "Lib_3D_Model_View.LG32" and just finished extracting the 3D model editor to put it in it's own program entity: "GB32 3D Model Editor.G32" Still too early to publish anything useful.
|
|