Can you complete this project?

Blitz3D Forums/Blitz3D Programming/Can you complete this project?

A. Create an program that does the following, using BlitzBasic3D

1. Create a blank database that contains 1 string, 9 floats, 1 byte
and 1 integer. Use at least 100 of the above set in this custom
database file.

2. Fill the database with Null data

3. Create a model from scratch. Using the blitz mesh creation
command set. this model must have more than 90 verts and less
than 200 verts

4. Copy the mesh 9 times, give each copy its own scale rotation
position, blend mode, and FX flags

5. Export the model to B3D file format.

6. Insert all 10 model filenames, position,rotations,scales, flags, and blend modes into the database.

7.end program

Email me at darcnier@... if you have this done.

Hee hee, I'm looking forward to the responses to this post.

Piece of cake - how much you paying ?

What college are you at? :)

wostzit for?

When's your assignment/homework due in?

i saw an sql module for blitz somewhere, but never tried it, have a look in the .dll section

I think the task refers to a custom made database using Blitz3d code . The use of external dll's may not be allowed.
A collection of Types or a structured Memory Bank could be used to hold the data in memory. You just need to design a file format and functions which writes/reads the values to/from a file.

This is not my homework. I was just wondering if anyone could complete this for me. I havent done it yet. I just needed some help.

Smiff, can i have your email address? I need to ask you something :o)

Can someone please help me. I will try and pay them when I get money. I am new to this and Need help.

Maybe, instead of thinking of something you want to do that's clearly beyond your ability and asking others to do it for you, you should start with something simpler?

I can to this community for help not criticism.

Just a quick question, What is the program for ?

/Alienforce

I can to this community for help not criticism.
That was advice, not criticism.

Ok it was a project for school but since I havent been tought this...Extra Credit...I am in need of assistance if you would be kind enough.

I'll help u with #7.

end


Ok, just kidding... I am actually feeling charitable today, so I did much of your work for you. The making a model from scratch you will have to figure out on your own, though, I just tested with cubes, and you will have to hunt down the 'b3dfile.bb' include, and modify the 'saveB3d' function from the code archives to do the exporting.

Include "b3dfile.bb"

Type dbMdl
	Field name$,posx#,posy#,posz#,rotx#,roty#,rotz#,sclx#,scly#,sclz#,blendmode,fxflags
End Type

FillDatabase()

Dim model(9)

Graphics3D 800,600,0,2

camera=CreateCamera()
PositionEntity camera,0,0,-100

light=CreateLight()
TurnEntity light,45,45,0

m.dbMdl = First dbMdl
model(0) = createmodel()
m\name$ = "model0.b3d"
m\posx = EntityX(model(0))
m\posy = EntityY(model(0))
m\posz = EntityZ(model(0))
m\rotx = EntityPitch(model(0))
m\roty = EntityYaw(model(0))
m\rotz = EntityRoll(model(0))
m\sclx = 1
m\scly = 1
m\sclz = 1
m\blendmode = 1
m\fxflags = 0

; copy meshes and randomize attributes 
; and add to type list
For a = 1 To 9
	m = After m
	model(a) = CopyMesh(model(0))
	thisname$ = "model" + a + ".b3d"
	PositionEntity model(a),Rnd(-50,50),Rnd(-50,50),Rnd(-10,10)
	RotateEntity model(a),Rand(-180,180),Rand(-180,180),Rand(-180,180)
	thisscalex# = Rnd(0.1,3)
	thisscaley# = Rnd(0.1,3)
	thisscalez# = Rnd(0.1,3)
	ScaleEntity model(a),thisscalex,thisscaley,thisscalez
	thisblendmode = Rand(1,3)
	thisfx = Rand(0,32)
	EntityBlend model(a),thisblendmode
	EntityFX model(a),thisfx
	m\name$ = thisname$
	m\posx = EntityX(model(a))
	m\posy = EntityY(model(a))
	m\posz = EntityZ(model(a))
	m\rotx = EntityPitch(model(a))
	m\roty = EntityYaw(model(a))
	m\rotz = EntityRoll(model(a))
	m\sclx = thisscalex
	m\scly = thisscaley
	m\sclz = thisscalez
	m\blendmode = thisblendmode
	m\fxflags = thisfx
Next

;export .b3d files 
For a = 0 To 9
	WriteBB3d(thisname$,model(a) ; you'll have to find the 'SaveB3d' function in the code archives and modify it to work here
Next

SaveDatabase("data.dbf")

While Not KeyHit(1)
	UpdateWorld
	RenderWorld
	Flip
Wend

End 

Function FillDatabase()
	For a = 1 To 100
		m.dbMdl = New dbMdl
		m\name = ""
		m\posx = 0
		m\posy = 0
		m\posz = 0
		m\rotx = 0
		m\roty = 0
		m\rotz = 0
		m\sclx = 0
		m\scly = 0
		m\sclz = 0
		m\blendmode = 0
		m\fxflags = 0
	Next
End Function 
		
Function SaveDatabase(filename$)
	If filename$ <> 0
		wfile = WriteFile(filename$)
		For m.dbMdl = Each dbMdl
			WriteString wfile,m\name
			WriteFloat wfile,m\posx
			WriteFloat wfile,m\posy
			WriteFloat wfile,m\posz
			WriteFloat wfile,m\rotx
			WriteFloat wfile,m\roty
			WriteFloat wfile,m\rotz
			WriteFloat wfile,m\sclx
			WriteFloat wfile,m\scly
			WriteFloat wfile,m\sclz
			WriteByte wfile,m\blendmode
			WriteInt wfile,m\fxflags
		Next
		CloseFile wfile
	EndIf
End Function

Function CreateModel()
	;you do this part ;)
	;temporary just for testing
	ent = CreateCube()
	Return ent
End Function


Even better:

Function SaveDatabase(filename$)
	If FileName$="" Then Return
	If Lower$(Right$(FileName,4))<>".xml" Then FileName$=FileName$+".xml"
	wfile = WriteFile(filename$)
	WriteLine wfile,"<ModelDatabase>"
	For m.dbMdl = Each dbMdl
		WriteLine wfile,"	<Model Name="+m\name+">"
		WriteLine wfile,"		<Pos x="+m\posx+" y="+m\posy+" z="+m\posz+"/>"
		WriteLine wfile,"		<Rot x="+m\rotx+" y="+m\roty+" z="+m\rotz+"/>"
		WriteLine wfile,"		<Scl x="+m\sclx+" y="+m\scly+" z="+m\sclz+"/>"
		WriteLine wfile,"		<BlendMode>"+m\blendmode+"</BlendMode>"
		WriteLine wfile,"		<FXFlags>"+m\fxflags+"</FXFlags>"
		WriteLine wfile,"	</Model>"
	Next
	WriteLine wfile,"</ModelDatabase>"
	CloseFile wfile
End Function
to impress your teacher... checkout one of the XML readers in the code archives to read the file properly.


I will try and pay them when I get money


I was just kidding - your original post sounded more like a demand but I'm sure that wasn't intentional ;)

@ Ross C - sent you email !

Jeez guys- that's not "can someone help me out", its "do my homework for me, so I don't have to". The idea of school work is to learn something, which you never will doing it like that, unless you're on a people management course, in which case you passed with flying colours!

AND as you see tyypes create a "type" of database in Blitz... I suggest you study them (and all other aspects of the programming language!) If you simply look in the FAQ files it would be understandable enough from the samples...

Ok it was a project for school but since I havent been tought this...Extra Credit...

So you want extra credit for doing bugger all? What is this world coming to? No wonder qualifications aren't worth the paper they're printed on these days. Sheesh.

I think he's off to a great start at becoming a CEO of a major company. :-)

Thanks guys. Ross C my email is DARCNIER at HOTMAIL dot COM

sswift?

I got the include file.

darc:
Are you asking why my nickname is sswift? Because my name is Shawn Swift. :-)

No. You said I think hes off to a great start at becoming a CEO of a major company.

Yeah... my company provides tech support for several big contracts and the managers there won't even try to press 4 buttons on the dang printers to get a page count... They all want a tech to come to site and do it for them!

" No. You said I think hes off to a great start at becoming a CEO of a major company."

Yes, because liars and cheats prosper in corporate America, and honest hardworking people never get anywhere. :-)

See:
WorldCom, Enron, Microsoft, Haliburton, Exxon, etc etc etc.