Advertisement

how to create a world file

Started by November 04, 2004 07:14 PM
12 comments, last by dawidjoubert 20 years ago
so there is no performance issue involved? (such as calculating triangles gives you higher FPS than calculating quads..etc?)
i think that there is a performance issue. New graphic cards are optimized to draw triangles....
Advertisement
Everything eventually gets to triangles anyway. Even if you tell OpenGL to draw a quad, it will do the manual transform itself to turn the quad into 2 triangles. Telling OpenGL to use quads is merely for your benefit so if you can pattern your thinking around the triangles you'll get a better understanding of what OpenGL is doing as it goes along and you see things you didnt expect.
Hard work USUALLY pays off in the future, but laziness ALWAYS pays off right now.
No need to get to involved in 3ds and stuff here save this to a .raw

[SOURCE]-------------------------------------------- Script by Alexandre Ribeiro de Sá    ---- http://sites.uol.com.br/alex_r       ---- 3DSMAX GameTutorials RAW File Export ---------------------------------------------- This script just export editable mesh-- Este script só exporta editable mesh-------------------------------------------- This script work with GameTutorials Camera World Collision Tutorial.-- Este script funciona com o Camera World Collision do GameTutorials.-------------------------------------------- Any comments just e-mail to alex_r@vortexentertainment.com-- Qualquer comentário envie um e-mail para alex_r@vortexentertainment.com-------------------------------------------- How Use:-- 1- Download the script... Ok, this step is stupid -_-'-- 2- Load the script in 3DSMAX.-- 3- Press the Crtl + E to execute the script.-- 4- In MAXScript Dropdown menu, click in Utilities and select the--    GameTutorials Collision.-- 5- Click in Save .RAW File to export the editable mesh.-------------------------------------------- Como Usar:-- 1- Baixe o script... Ok, este paço é idiota -_-'-- 2- Carregue o script no 3DSMAX.-- 3- Pressione Crtl + E para executar o script.-- 4- No menu do MAXScript, clique em Utilities e selecione--    o GameTutorials Collision.-- 5- Clique em Save .RAW File para exportar os editable mesh.------------------------------------------global x = 0global IndexValue = 0global ostreamglobal FaceCount = 0-------------------------------------------------------------------------------------function GetSaveFileStream =(	fname = GetSaveFileName types:"GameTutorials RAW File (*.raw)|*.raw|All Files(*.*)|*.*|"	if fname == undefined then		return undefined		ostream = CreateFile fname	if ostream == undefined then	(		MessageBox "Couldn't open file for writing !"		return undefined	)		return ostream)-------------------------------------------------------------------------------------function ExportMesh meshObj=(--        ^ z+--        |--        |--        |--        |--        |------------> y+--       /--      /--     /--    /--   <-- x+	for f = 1 to meshObj.numfaces do	(		ProgressTotal = 100.0*f/(meshObj.numfaces/2)		progressUpdate ProgressTotal		-- Retorna pontos		get_face1 = getFace meshObj f		get_vert = getVert meshObj get_face1[1]		format "% % %\n" get_vert[1] get_vert[3] get_vert[2] to:ostream					get_vert = getVert meshObj get_face1[3]		format "% % %\n" get_vert[1] get_vert[3] get_vert[2] to:ostream					get_vert = getVert meshObj get_face1[2]		format "% % %\n" get_vert[1] get_vert[3] get_vert[2] to:ostream		))-------------------------------------------------------------------------------------				utility GM2RAW "GameTutorials Collision"(	button btn_export "Save .RAW file..."	label lbl1 "GameTutorials RAW Exporter"	label lbl2 "Script by Alex_R"	label lbl3 "http://sites.uol.com.br/alex_r"	label lbl4 "Comments to:"	label lbl5 "alex_r@vortexentertainment.com"	label lbl6 "-- No Spam Please ;) --"		progressBar pbGeometry "ProgressBar" height:10		on btn_export pressed do	(		progressStart "Wait..."					objGeometry = geometry as array					ostream = GetSaveFileStream()		if ostream != undefined then		(					-- First We Count How Many faces there are in total			for x = 1 to objGeometry.count do					(				FaceCount =  FaceCount + objGeometry[x].numfaces			)			-- Save it first to file	        format "Faces=%\n" FaceCount to:ostream											-- Then We Just Save the faces			for x = 1 to objGeometry.count do			(				pbGeometry.value = 100*x/objGeometry.count				ExportMesh objGeometry[x]			)		)					Close ostream		progressEnd()	))[/SOURCE]


Then open 3dsmax and import it as max script, with the stuff selected to export hit save

And yes its about the same format
----------------------------

http://djoubert.co.uk

This topic is closed to new replies.

Advertisement