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.

AppGameKit Classic Chat / Some usefull 2D and 3D tools effects and snippets

Author
Message
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 10th Feb 2019 21:16 Edited at: 7th Mar 2019 23:58
A bare bones 3D Placement editor EDITED


Keys
F1 load an object and then an image to assign to it
f2 save test.data
L to delete all and load objects as set in test.data
<, > rotate object
+,- scale object
w,a,s,d,shift move camera
Clicking and holding mouse rotates mouse around its position
Right Clicking an Object moves camera to concentrate on that object (ie so it would rotate around that object)
arrow keys ,shift move current object

Function
creates a test.data file that can be later used in your program that can load a series of objects
saving there name, scale, xangle, yangle, zangle, xpos ypos, and zpos

Note: It will save the file test.data in the same directory as the last object loaded

Using the data You could then use this function in your program to load position rotate etc your objects
fubar
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Feb 2019 12:43 Edited at: 11th Feb 2019 12:49
Hi fubarpk

Nice programm . I tested loading and placing two objects pressing f1 and f2 ...then I try to load and couldn't fine file ...I just checked every thing in media folder and realize that the file created was "tetest.data" ....it should be "test.data" instead of tetest.data so it was easy to find where was the error ...in line 96 , instead of :

Quote: "saveData(objects,"raw:"+left(ret$,len(ret$)-(len(objects[current].name)+1))+"test.data")"
... I had to write

saveData(objects,"raw:"+left(ret$,len(ret$)-(len(objects[current].name)+3))+"test.data")



with this change, I can now save both objects and load them again pressing L key
When I load a third object and save it again it just is not there...
I realize aswell that when we scale object and save, ....when load it, the object doesn't keep the scaling... I think that should be easy to mend just setting object pivot ...and setting object permanent scale.
I could with object pivot but couldn't with setobjectscalepermanent .

It is not a criticism but rather an observation any way with some adjustements is a good snippet

Edit.
When I place the object and try to save again I have a path error .


I'm not a grumpy grandpa

Attachments

Login to view attachments
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 11th Feb 2019 13:07 Edited at: 11th Feb 2019 13:49
Thanks Chafari
just something I threw together out of necessity

Quote: "saveData(objects,"raw:"+left(ret$,len(ret$)-(len(objects[current].name)+3))+"test.data")"

strange cos 1 works well for me the idea it just determines the raw path by subtracting the length of the last object name as the lengths begin at zero I needed to add one
I seem to recall you saying something about using Vista or something that may be the issue not really sure

Quote: "When I load a third object and save it again it just is not there..."

not sure it may be the array objects will look later I thought if I deleted everything in the array and if I set current to -1 it would work

Quote: "I realize aswell that when we scale object and save, ....when load it, the object doesn't keep the scaling"

the command is there in loadobjects just commented out


Quote: "When I place the object and try to save again I have a path error ."

I think that's because you have loaded with test.data and not loaded another object to get a new path to save to and test.data having a different extension
I should have a variable that sets it so as the file wont save again unless there is changes and perhaps a message displaying if saved or not

Hahahah its bound to have a few bugs I just whipped it up hoping it could be of help to me but thought ide share, it was painstaking trying to place the billboards in KrazyGrandPrix otherwise

EDITED the above code to only allow saves when there is changes and some message boxes so as can see whats happening
fubar
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 13th Feb 2019 01:21 Edited at: 13th Feb 2019 07:33
A Shatter-Sprite Routine
was experimenting with a shatter routine for 2D like I have used for 3D in the Past
could be used when you don't have an exploding sprite animation I guess. The 3D
version is much more effective

for this one I used the below image


PS: I think a shader could do the same effect nicer as what really needs to be done is have all pixels move outward in a circular way and could just have a larger
image than shown with allot of transparency to compensate and move each pixel outwards

Could possibly be improved with a memblock by reading each colour of an image from left to right top to bottom and writing that colour on the image one to the left and one above
for all pixels in the left quarter zone of the image. then repeated for all other quarters as needed. Curious how that will work may or may not try later as I think it may be slow

Experimenting with just two sprites and scaling them doesn't work anywhere near as well I prefer the top snippet ohwell lol
fubar
puzzler2018
User Banned
Posted: 13th Feb 2019 07:11
Wow - this looks interesting.

Cannot wait to test it out later on after work.

On Lemmings - I had the similar premise on shattering the follower in similar manner.

Cool

Tier 1 Developer
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 13th Feb 2019 07:44
Quote: "Wow - this looks interesting."

Ide also like to try as a memblock

where an image is though of as quarters
1,2
3,4
zone 1 pixels would move one to the left and one upward
zone 2 pixels would move one to the right and one upward
zone 3 pixels would move one to the left and one down
zone 4 pixels would move one to the right and one down

I think that could give a nice effect still not like it works in 3d as parts lol but might look good

then return the new image
replace old image with new one
maybe delete old image for code housekeeping

just will have to have a think about memblocks first as a slight incorrect placement will cause program crashes
fubar
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Feb 2019 22:03
Nice work fubarpk I try to press spacebar twice but couldn't get it repit
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 17th Feb 2019 19:11
So just that we dont loose touch with this - may come in handy with lots of things

Object Mesh Building



Left click block to raise
Right click block to lower

Space and mouse move changes camera

Tier 1 Developer
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 17th Feb 2019 19:16 Edited at: 18th Feb 2019 05:55
Thanks puzzler ive spent ages going through threads in the past
to find code that's buried deep in some other code in one of the pages
Object Mesh Building
Changed to the following this way it don't ever error and a few other things like crater creation etc
fubar
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 5th Apr 2019 01:00 Edited at: 5th Apr 2019 01:01
2D Clouds Sprite Shader


3D Clouds Shader Same as above but 3D version
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk

Login to post a reply

Server time is: 2019-04-21 18:19:27
Your offset time is: 2019-04-21 18:19:27