3D Models Viewer

So you have written that new, must have program. Let us see it here.
User avatar
tincho
Posts: 57
Joined: Wednesday 10th July 2019 1:12pm

3D Models Viewer

Post by tincho »

Hello friends,
Image
Here I share with you this program we made together with TercoIDE to experiment with OpenGL in 3D.
The latest version is in the Gambas Farm and also in the gitlab repo. https://gitlab.com/belmotek/stl-viewer
Image
Image
  • 1 - Open a 3D model
  • 2 - Load texture
  • 3 - Object color
  • 4 - Background color
  • 5 - Wireframe on-off
  • 6 - Texture on-off
  • 7 - Othogonal view estandar
  • 8 - Ortographic camera on-off
The other buttons that are not listed are either not relevant to the operation of the programme or do not yet work.
Image
Enjoy it.
Last edited by tincho on Saturday 17th December 2022 11:51am, edited 2 times in total.
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: STL Viewer

Post by Quincunxian »

Downloaded from git hub and extracted to my Project Folder.
On run, I get a 'cannot find dynamic library libGl.so'
Cheers - Quin.
I code therefore I am
User avatar
tincho
Posts: 57
Joined: Wednesday 10th July 2019 1:12pm

Re: STL Viewer

Post by tincho »

Quincunxian wrote: Thursday 15th December 2022 10:33pm On run, I get a 'cannot find dynamic library libGl.so'
ok, you have two possibilities, either the library is not installed on your system or the module cannot load it.
I have added a patch to warn, when the program ir running from the IDE, with a dialog box in case the library is not installed.
On the other hand it may happen that you do have the library installed so there are other diferent situation.

Please follow these steps to help me to debug the program.
1 - Download the new code from gitlab.
2 - Inform if you get any message about the distribution or about the libGL library status.
3 - Install the libgl-dev package (in ubuntu)
4 - If it still doesn't work, tell me what distro you are using with the output from:
cat /etc/[A-Za-z]*[_-][rv]e[lr]*
And this
locate libGL.so

Thanks for the fedback
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: 3D Models Viewer

Post by Quincunxian »

You can also get the system information from Gambas.
Help [? menu] & System Information.
It gives a lot more data than the cat statement you provided.
locate fails to find libGl.so - assume that this is becaue the version on my machine is named libGl.so.1.7.0 (highlighted in red below)
---------------------------------------------------------------------------------------
[System]
Gambas=3.17.3
OperatingSystem=Linux
Kernel=5.4.0-135-generic
Architecture=x86_64
Distribution=Linux Mint 20.3 Una
Desktop=CINNAMON
Font=Ubuntu,10
Scale=7
Theme=mint-y
Language=en_AU.UTF-8
Memory=15882M

[Libraries]
Cairo=libcairo.so.2.11600.0
Curl=libcurl.so.4.6.0
DBus=libdbus-1.so.3.19.11
GDK2=libgdk-x11-2.0.so.0.2400.32
GDK3=libgdk-3.so.0.2404.16
GStreamer=libgstreamer-1.0.so.0.1603.0
GTK+2=libgtk-x11-2.0.so.0.2400.32
GTK+3=libgtk-3.so.0.2404.16
OpenGL=libGL.so.1.7.0
Poppler=libpoppler.so.97.0.0
QT5=libQt5Core.so.5.12.8
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
CINNAMON_VERSION=5.2.7
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
DESKTOP_SESSION=cinnamon
DISPLAY=:0
GB_GUI=gb.gtk3
GDMSESSION=cinnamon
GDM_LANG=en_AU
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/gambas3.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=13288
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK3_MODULES=xapp-gtk3-module
GTK_MODULES=gail:atk-bridge
GTK_OVERLAY_SCROLLING=1
HOME=<home>
LANG=en_AU.UTF-8
LANGUAGE=en_AU.UTF-8
LC_ALL=en_AU.UTF-8
LOGNAME=<user>
MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=<home>
QT_ACCESSIBILITY=1
QT_LOGGING_RULES=*.debug=false
QT_QPA_PLATFORMTHEME=qt5ct
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/1140,unix/<hostname>:/tmp/.ICE-unix/1140
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=1214
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TZ=:/etc/localtime
USER=<user>
XAUTHORITY=<home>/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
XDG_CURRENT_DESKTOP=X-Cinnamon
XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:<home>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<user>
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=cinnamon
XDG_SESSION_ID=c2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
----------------------------------------------------------------------------------------------------------------------------------------
Full system file search for libGl.so
Full system file search for libGl.so
Selection_001.png (49.46 KiB) Viewed 6846 times
Hope this helps.
If you need anything else or for more testing - let me know.
Cheers - Quin.
I code therefore I am
User avatar
tincho
Posts: 57
Joined: Wednesday 10th July 2019 1:12pm

Re: 3D Models Viewer

Post by tincho »

Quincunxian wrote: Saturday 17th December 2022 3:29am You can also get the system information from Gambas.
Help [? menu] & System Information.
It gives a lot more data than the cat statement you provided.
locate fails to find libGl.so - assume that this is becaue the version on my machine is named libGl.so.1.7.0 (highlighted in red below)
hehe, sometimes a lot of information is at the same time no information at all. Besides, the information provided by gambas is "ordered", I prefer raw data.
In this case the information you send doesn't allow me to know if you have or don't have the libgl-dev package installed on your system.
Just to check I have uninstalled the package on my system, then gambas info continues to deliver the same information as before which is the same as the one you send.
Image
So that leaves us to check outside of gambas what is installed on your system, with apt or synaptic maybe.
I add some codeo to check it but you can do it by the terminal also:
dpkg-query -W -f='${Status}\n' libgl-dev
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: 3D Models Viewer

Post by Quincunxian »

The output from the last command:
dpkg-query: no packages found matching libgl-dev

So that answers that question.

Next steps ?
Cheers - Quin.
I code therefore I am
User avatar
tincho
Posts: 57
Joined: Wednesday 10th July 2019 1:12pm

Re: 3D Models Viewer

Post by tincho »

Quincunxian wrote: Sunday 18th December 2022 1:09am The output from the last command:
dpkg-query: no packages found matching libgl-dev
So that answers that question.
Next steps ?
if your distro is "Linux Mint 20.3 Una" wich is based on Ubuntu 20.04 LTS (Focal Fossa).
I read in the ubuntu package list there is libgl-dev:
https://packages.ubuntu.com/focal/libgl-dev
https://packages.ubuntu.com/focal-updates/libgl-dev
Then in Ubuntu 22.04 LTS (Jammy Jellyfish) based versions there is also the package.

Apparently the package does not exist in previous versions like Ubuntu 18.04 (Bionic Beaver).
So your system is not 20.30, it is not up to date or there is some other problem whose solution is beyond my scope.
I don't use Mint, but try

sudo apt update && sudo apt dist-upgrade && sudo apt install libgl-dev

Sorry, but if you fail to install the libgl-dev package 3D Model viewer will not work.

Best regards.
Martin.
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: 3D Models Viewer

Post by Quincunxian »

Thanks Martin.
I'll give it a try and see where I get to.
Cheers - Quin.
I code therefore I am
User avatar
Technopeasant
Posts: 140
Joined: Saturday 13th July 2019 6:50pm
Location: Stony Plain, Alberta, Canada
Contact:

Re: 3D Models Viewer

Post by Technopeasant »

Installed from the Farm and got a type error.
Attachments
Screenshot_2022-12-25_22-22-49.png
Screenshot_2022-12-25_22-22-49.png (192.5 KiB) Viewed 6725 times
Technical director,
Piga Software
http://icculus.org/piga/
User avatar
tincho
Posts: 57
Joined: Wednesday 10th July 2019 1:12pm

Re: 3D Models Viewer

Post by tincho »

Technopeasant wrote: Monday 26th December 2022 5:23am Installed from the Farm and got a type error.
Hello, a moment ago I uploaded the changes to fix this error.
I hope it works fine now.
Thanks for the feedback.
Martin.
Post Reply