Author Topic: 3D Modeler for Icaros  (Read 2129 times)

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #90 on: August 31, 2019, 07:35:00 AM »
We have to start somewhere. Each step takes time. Displaying a simple 3d wireframe is the first step. The rest of the functionality will follow.

The next step while developing the toolbar and a simple menu system will be to actually select and load an IFF-RSCN file. The 3d object data is then used to display a "REAL" 3d wireframe in the viewports. That will take considerable time to achieve.

Getting the display for the wireframes and view operations right is critical. That's one of the main ways the user interacts with the program. Having full control of the wireframe display allows changing the background and foreground colors of the viewports, setting the font and color for the text in the viewports, etc. Fine tuning the look and feel of the images in the viewports is important.

So at first we'll be able to display a simple wireframe then build more functionality as we go. It's a lengthy process but worthwhile.
« Last Edit: August 31, 2019, 07:52:51 AM by miker1264 »

salvatore

  • Guest
Re: 3D Modeler for Icaros
« Reply #91 on: August 31, 2019, 10:36:27 AM »
i understand, horewer i have one beta tester maybe :)

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #92 on: September 01, 2019, 07:09:11 PM »
Success!
Yes. My first successfully compiled OpenGL/Glut demo.
Again - Thanks to Allain Thellier for his hard work!
 
While searching in the demos sections of  Icaros Desktop I couldn't find any that worked.
So I found a sample on the net called "Spheres". In the code at the top with the includes
was this note: "//For programs that simply use OpenGL and Glut (like Aminet/ccstarship) then just compile them
//gcc starship.c -lglut -lgl - o starshiparos"

So I downloaded the source and compiled with the above syntax. It worked.
The syntax I was generically using was "gcc -o program -lglu -lgl program.c". It shoud be "-lglut" not "-lglu".

This little demo doesn't seem like much, but I needed was how to use glut (OpenGL Utility Toolkit) to create
an OpenGL Context and Link it to an AROS display window. So the demo was a success. Now on to Wireframes!!

If you're interested in trying the demo unzip the zip file and then use the shell to run the "starshiparos" executable.
« Last Edit: September 01, 2019, 07:17:37 PM by miker1264 »

trekiej

  • Member
  • ***
  • Posts: 157
  • Karma: +1/-0
Re: 3D Modeler for Icaros
« Reply #93 on: September 01, 2019, 08:43:47 PM »
Congratulations.

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #94 on: September 01, 2019, 09:12:21 PM »
Congratulations.

Thank you.

Thanks to kalamatee for giving me a few pointers on OpenGL rendering libraries!

Here is the first wireframe using OpenGL.

Next I'll divide the window into OpenGL Viewports to display different perspective.
« Last Edit: September 01, 2019, 09:16:09 PM by miker1264 »

salvatore

  • Guest
Re: 3D Modeler for Icaros
« Reply #95 on: September 02, 2019, 02:11:44 AM »
great miker :)

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #96 on: September 05, 2019, 08:06:33 AM »
Continuing to experiment with OpenGL Wireframes and Viewports.
I think a light grey color for the wireframes would look nicer and
I will attempt to draw a line in the form of a "cross" to divide the
individual viewports. It would look better inside of an MUI/Zune
Drawing Area with a ButtonBar Menu, Toolbar Menu & Buttons.

This is close to actual size for the viewing area, but I can't make
the Mesh Window larger than 640x400 because it has to fit into
an 800x600 screen size. My Icaros Desktop is only at 800x600.
There may be an option later to resize it to 1024x768, or larger.
« Last Edit: September 05, 2019, 08:11:42 AM by miker1264 »

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #97 on: September 05, 2019, 08:18:50 AM »
Here is the code I used to generate the wireframe viewports.

salvatore

  • Guest
Re: 3D Modeler for Icaros
« Reply #98 on: September 05, 2019, 12:37:17 PM »
thank you miker, i attemp for first releasing

all great
« Last Edit: September 05, 2019, 12:40:29 PM by salvatore »

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #99 on: September 05, 2019, 02:22:01 PM »
This is just the beginning. Much more work to do just for the user interface and wireframes and viewing operations then integration with IFF SCN.

I'll report back when I have a working user interface with toolbar, buttonbar and mesh windows that can display 3d wireframes so I don't clutter up the forum here with all my postings. ;-)
« Last Edit: September 05, 2019, 02:26:14 PM by miker1264 »

salvatore

  • Guest
Re: 3D Modeler for Icaros
« Reply #100 on: September 05, 2019, 05:00:49 PM »
ok

all best and thank you

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #101 on: September 07, 2019, 07:29:40 PM »
I did say I didn't want to clutter the forum with all my comments and updates, but I lied. I'm back.

As far as a 3D Modeler for AROS it's becoming a reality, slowly. I envision a modeler program that is perhaps 60% new and 40% based on existing code. In some ways it's like AROS itself, "Rooted in the Past, with a Firm Footing in the Present, and an Eye Towards the Future".

But you might say, the Sources for RayStorm and other 3d programs already exist. Why can't we just port it to AROS? The sources for RayStorm for example were first written many years ago for an operating system other than Amiga then more recently (2014?) Ported to Amiga OS 3.x. There is much legacy cpp code there and many, many modules! The Original Viewer Module for example contains older code that relies on picture libraries. But picture datatypes have advanced quite a bit and they can handle the viewer functions easily. So the new Viewer Component is 100% new code.

In order to write, design, layout the new program I must fisrt familiarize myself with new concepts such as OpenGL drawing techniques, gui design, handling 3d objects as data structures, vectors, vector math, optics and lighting, and especially the science behind Raytracing. When you research raytracing you soon realize there are different types. There is also POV Ray and Path Tacing.

There are well written articles about Raytracing at Scratchapixel.com for instance for some light reading if you're bored and can't sleep at night. :-)
« Last Edit: September 07, 2019, 10:58:06 PM by miker1264 »

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #102 on: September 07, 2019, 11:57:00 PM »
I'm refining the look and feel of the new program by experimenting with OpenGL drawing techniques, OpenGL Contexts (display window), foreground & background colors. I changed the wireframes (foreground color) to a medium grey which seems more appealing. I will also look into changing the color of the wireframe in the Active Viewport to a brighter Whitish-Grey for a visual effect. Drawing a Cross-Piece at the inner edges of the viewports to visually separate them will also make it look nicer. The color of the "+" will be white for the moment but should match the RGB value of the AROS window frame theme being used. There should be a way to query that color information for a closer match.

This is how I changed the foreground colors:

static void display(void) {
    glClear(GL_COLOR_BUFFER_BIT); //Black Background
    //glClearColor(1.0f, 1.0f, 1.0f, 0.0f); //White Background
    //glColor3f(1.0f, 0.0f, 0.0f); //red
    glColor3f(0.5f, 0.5f, 0.5f); //grey

//void glColor3f(
   //GLfloat red,
   //GLfloat green,
   //GLfloat blue
//);

There may also be a way to change the background color from black to white or light grey. I may allow User Preferences to Select Foreground & Background Colors. I plan to also have a ButtonBar Menu beside the Display Area (Mesh Window) and below that will be about eight Navigations Buttons to control view operations inside the Viewports. As far as User Preferences the ButtonBar and Navigation Buttons can be located on the Left or Right Side of the Window. The Toolbar can optionally be shown above the display area. But if you are like me and you prefer a "minimalist approach" then just showing the Display Window is perfectly fine! At that point it will all be Menu Operated rather than GUI Buttons. I kinda like having just a Display Area and a Menu System. It makes it easier.

I'm going to try to make the ButtonBar Menu and Navigation Buttons this weekend as well as an OpenGL Context to use an MUI/Zune display area instead of just a standard window. It has all been done before using StormMesa, but I enjoy the journey of discovery.

As far as my plan or my roadmap for this program, next week I plan to start out small reading the 3d object data from the IFF-RSCN "Scene File". I'll use the "Billiard Balls" scene or one similar with Spheres. They are easiest to model with wireframes. After displaying the wireframes in the Viewports I'll focus on sending Vector Data directly to the Raytracer to generate the final Rendered Image. On the other end I'm using a sample Raytracer called "Mini-Ray" to output the rendered images. It currently generates PPM files, but some people may not have the picture datatype for that, so I will modify it to also output TGA files.

salvatore

  • Guest
Re: 3D Modeler for Icaros
« Reply #103 on: September 08, 2019, 06:06:12 PM »
currently I'm devoting myself to something else that is always part of the world of computer science, to create a job I had mentioned this thing in another thread since 2004 that I don't work and I had serious health problems, now I have recovered a lot of lucidity but not easy, anyway miker long ago the users of the old forum complained about the lack of such software thanks for your work :)

miker1264

  • Senior Member
  • ****
  • Posts: 262
  • Karma: +11/-1
Re: 3D Modeler for Icaros
« Reply #104 on: September 08, 2019, 06:28:29 PM »
One of my dilemmas is that I really want to produce programs and small utilities that the AROS community might find useful, but my notes and concepts for programs far outweigh my ability to code quickly! So I work on a few at a time, making incremental improvements in each.

I'm working on the 3D Renderer (AROS will have one!) as well as the Icon Functions that will be a part of Icon Factory. I have spent many hours on that but still have many more to go till I feel that it can be released. Time is a precious commodity.

Though I work full time during the day I enjoy working with graphics. During the week I can only program or test programs for a couple hours per night but sometimes I take a night off. I have health issues too. I can't stand or sit for long periods of time so that limits my programming. I really want to code but at times I have to stop. But I have very detailed notes to continue exactly where I left off. I'm making good progress on the Viewports and Wireframes using OpenGL.

The Raytracer program is one of those major projects that will either secure my reputation for writing good and useful AROS programs, or it will make me want to run away from it screaming!!