Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / [SOLVED] BUG ? SaveImage() of 3D objects on screen only works for black & white objects

Author
Message
giouti
5
Years of Service
User Offline
Joined: 18th Mar 2019
Location:
Posted: 6th Apr 2019 10:46
Hello, I'm currently writing a 3D app , and want to save an image from a screen with 3D objects in it with SaveImage() : after several days of attempts I discovered that SaveImage() only works if the 3D objects are NOT colored with SetObjectColor() , otherwise the object itself does not appear in the output image.
With text instead, SaveImage() works also with SetTextColor(). This happens for both AppGameKit 2 & AppGameKit Studio.
If needed , I can provide my code and sample output images for this situation.
Thank you, regards
Giorgio

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 7th Apr 2019 23:03 Edited at: 7th Apr 2019 23:06
This post has been marked by the post author as the answer.
try this:


it's my first time playing with GetImage() but it works. saving as PNG, tho... i'm not sure what i need to do to retain the background color in the file (.jpg is fine).

otherwise, i'd consider SetRenderToImage(), instead (which, IIRC, retains the BG color).

meanwhile, show us a code example where i'm not experiencing any "black and white" issues:

Attachments

Login to view attachments
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 8th Apr 2019 00:18
This works fine:



PSY LABS Games
Coders don't die, they just gosub without return
giouti
5
Years of Service
User Offline
Joined: 18th Mar 2019
Location:
Posted: 8th Apr 2019 17:50
Hello, first of all thank you so much both Virtual Nomad & PSY Labs for your replies !
Both snippets work as expected on my system (pls see attached test.png & test1.png where I have set cylinders instead of boxes) , and that's exactly what I did in my code :
Render()
simg = GetImage(0,0,G_width,G_height)
SaveImage(simg,"cake.png")
G_width & G_height of course are both initialized and valid values.
The only difference from your code is that I'm currently using LAG_Library 0.77 (which I found on the forums) for building menus & buttons on screen, and it's probably this library that doesn't perform well, even if I couldn't believe it ! It uses sprites for menus , and as you can see in attached testcake.png, only B&W object (a rose) and menus are visible.
Thank you very much again for your help! ... May I ask you : are there any other menus building frameworks currently available on the forums or is it better to build them on my own ?
Best regards,
Giorgio
giouti
5
Years of Service
User Offline
Joined: 18th Mar 2019
Location:
Posted: 9th Apr 2019 08:38
Whoops ... here are the files mentioned above.

Attachments

Login to view attachments
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 11th Apr 2019 06:56
I prefer building my own menues


PSY LABS Games
Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2024-03-29 08:14:48
Your offset time is: 2024-03-29 08:14:48