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.

DarkBASIC Discussion / Saving command

Author
Message
Jmahmood
19
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 12th Jul 2007 17:56
Hi people
I m working on a 3d modeling software called R.T.M.
Anyway,
I am having some problem with the saving command.

In the program u can scale and change position of the object.I need to know how to save their position and scaled value.

in the code, as u can see i can save the position and scaled value of only one object..But i need to save the values of multiple objects.

As an example,I need to save five differnt value for five different object.
Can someone help me please.



I m useing the following command to save

Save:
filter$ = "RTM files (*.rtm)|*.rtm|All Files (*.*)|*.*"
F$ = call dll(1,"savedialog",filter$,"rtm","Save RTM File",GET DIR$() )

if F$<>""
open to write 1,F$





write long 1,sx
write long 1,sy
write long 1,sz

write long 1,xx
write long 1,yy
write long 1,zz

write long 1,rx
write long 1,ry
write long 1,rz

write long 1,w
write long 1,saveon
endif




close file 1


show window
endif
endif


and to load

Load:
filter$ = "RTM files (*.rtm)|*.rtm|All Files (*.*)|*.*"
F$ = call dll(1,"loaddialog",filter$,"rtm","Load RTM File",GET DIR$() )

if F$<>""
open to read 1,F$

read long 1,sx
read long 1,sy
read long 1,sz

read long 1,xx
read long 1,yy
read long 1,zz

read long 1,w
read long 1,om

read long 1,rx
read long 1,ry
read long 1,rz

close file 1
endif

om=om-300
if om=1
om=om+1
make object box om,50,50,50
position object om,xx,yy,zz
scale object om,sx,sy,sz
texture object om,w

endif

show window
endif
Jmahmood
19
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 12th Jul 2007 18:00
I cant provide u the full source code due to copyright.
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Jul 2007 21:00
I don't recognize the following API saving convention:



I'm assuming this is from a custom DLL that accesses the windows api itself, because this is not a call to the windows API save function. If you were actually making a call to the windows api it would look like:


The lpOPENFILENAME is a pointer to a structure that contains all the aspects of the file(s) and dialog box that you want to save or open. One of the flags that can be set is OFN_ALLOWMULTISELECT which allows the multiple selection of files. But I don't think this will help with your question.

If your save function works to save a single object, why not set up an array that stores all of the scaling of the various objects you want to save. The positions are already easily referenced by OBJECT POSITION etc. Then setup a loop and run through the save routine each iteration of the loop replacing the info of the specific object (including the scale that you saved in your custom array). When you load back the information, remember to include a reference to your array of scale values. If you need to save the objects as different files, then you would have to open and close the file number reference in between the save call in the loop, if not, leave it open and use an indicator between objects that identifies the start and end of a saved object.

Any particluar reason your are writing LONGs instead of floats? The object's position could be fractional.

Enjoy your day.
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 12th Jul 2007 22:30
how much will this software cost when it is done?

The problem with the gaming community is people think that the resolution of a game defines how good it is. I am not afraid to make a game where the main character is 50x50.
Jmahmood
19
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 13th Jul 2007 07:30
@Latch,
Yes that command u mentioned is used to call a .dll which opens a new window

@Pixelator,
The software is being made for real estate companys.They will use it to show 3d models of their house/apartment to their customer. For version 1.0 i will get 500$ for each and every purchase.

Login to post a reply

Server time is: 2026-07-06 11:38:41
Your offset time is: 2026-07-06 11:38:41