Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Aplication][Blitz] Model Viewer
Index -> Programming, Visual Basic and Other Basics -> Other Basics
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jonos




PostPosted: Mon Mar 08, 2004 11:23 pm   Post subject: [Aplication][Blitz] Model Viewer

its fixed now!!!

If you are like me and you are just sick of using the 3D Max way of viewing your models or whatever modeler you use, you just want something easy that you can cruise around your model with, with controls similiar to fps. welll i made this because its easy that way, and if you want it made into a .exe then just tell a blitzer here and tehy wiill do it (including me).

this took me around 20 mins just cause im really tired and had to learn about mousex, mousey and all that stuff.

edit: oops i posted the wrong program...i can't find the one where you type the path and everything so you'll just have to modify the code in the appropriate place in order the get model and the texture. just use a bmp for a texture, im not sure about other picture formats.

code:

Graphics3D 800, 600

SetBuffer BackBuffer()

;camera
camera=CreateCamera()
PositionEntity camera, 0, 0, 0

;light
light=CreateLight()

model=LoadMesh ("person.3ds")
PositionEntity model, 0, 0, 10

;texture
;texture=LoadTexture("ballTexture.bmp")
;EntityTexture torus, texture

While Not KeyDown(1)
;movement
If KeyDown(201)=True Then y#=1
If KeyDown(209)=True Then y#=-1
If KeyDown(30)=True Then x#=-1
If KeyDown(32)=True Then x#=1
If KeyDown(17)=True Then z#=1
If KeyDown(31)=True Then z#=-1

MoveEntity camera, x, y, z

;rotating
RotateEntity camera, MouseY(), MouseX(), rz
If MouseX() >780 Then MoveMouse MouseX()-1, MouseY()
If MouseX() <20 Then MoveMouse MouseX()+1, MouseY()
If MouseY() >580 Then MoveMouse MouseX(), MouseY()-1
If MouseY() <20 Then MoveMouse MouseX(), MouseY()+1

UpdateWorld
RenderWorld
Flip

x=0
y=0
z=0
Wend
End


some code may be useless because i haven't cleaned it up, but im new to blitz so sue me, i don't care.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Tue Mar 09, 2004 4:04 pm   Post subject: (No subject)

I'm not familier with what the viewing system is like in 3DSMAX. is it basically the same except with keys? if so, I'm going to look really stupid when I suggest the following:
make it so that you can use the mouse and the keys. I say this because there was one game that came with blitz where you used the mouse to rotate the camera around an object and then clicked and all these balls shot out and went towards a black hole. Anyways, I found that the mouse was often really too fast and you couldn't control it.
I haven't looked at your program however, just looked at the code (I don't have any 3dsmax objects on my computer.. though I prolly have some 3d object from some game somewhere... what are the extensions of the files that this allows?)
jonos




PostPosted: Tue Mar 09, 2004 4:20 pm   Post subject: (No subject)

well in 3dmax you have to click another buttron and then drag the mouse around this circle that shows up, and its hard (i find it) to take a good look at your model.

i have it with arrow keys, also in another prog but i didn't really like it, so i didn't add it. its not hard: when up arrow key is pressed z=z+1 and stuff like that.

blitz only supports .3ds and .x which i don't really know about. i think i read that in the blitz thing. i will post a model for people who don't have one.

i think there is a mousesensitivity() thing in blitz that i saw in shorthair's shooter game, but i don't know how to use it.

this was also good practice for trying to make a fps.
Cervantes




PostPosted: Tue Mar 09, 2004 5:33 pm   Post subject: (No subject)

mousesensitivity()? sounds familiar. but I just looked in the command reference and didn't find anything. however, there is mousexspeed, mouseyspeed, and mousezspeed.

If you wanted to slow it down though, couldn't use just delay? also, though I still haven't tried it out (will tommorow, today is very busy Sad ) you can use MouseMove to move the mouse to the centre of the screen, so that you can rotate the object infinately in one direction, without having the problem of hitting the edge of your screen.
jonos




PostPosted: Tue Mar 09, 2004 10:26 pm   Post subject: (No subject)

wow!!!! thanks...

and when did you become moderator, awesome!!!
i do other basics too Crying or Very sad mabye im not responsible

edit:
oops, movemouse prevents me from moving the mouse at all. you can't move the figure then. or else i am missing something, and yeah, i mixed up mousesensitivity with mousexspeed, mouseyspeed - i haven 't use them and ive only seen then once or twice. thanks for the help.
Cervantes




PostPosted: Tue Mar 09, 2004 10:58 pm   Post subject: (No subject)

again, I haven't tried this, but I think that the placement of mousemove is important. I'd imagine you would have to move it at the beginning of the loop, then have your code for moving it, then delay... I think the movemouse and the code for rotating the camera should be separated by the delay, if you have one.

If that still doesn't work, post the updated code up top
jonos




PostPosted: Wed Mar 10, 2004 8:06 am   Post subject: (No subject)

yes, cause in counterstrike you never have the problem of moving the mouse off the screen or in any other game, same with shorthait's i think but i haven't tried.

here is the code with a delay, and it still doesn't work. maybe i have to work and manipulate the cameras or something to allow that, or mayber shorthair knows what to do...

code:

Graphics3D 800, 600

SetBuffer BackBuffer()

;camera
camera=CreateCamera()
PositionEntity camera, 0, 0, 0

;light
light=CreateLight()

model=LoadMesh ("person.3ds")
PositionEntity model, 0, 0, 10

;texture
;texture=LoadTexture("ballTexture.bmp")
;EntityTexture torus, texture

While Not KeyDown(1)
;movement
If KeyDown(201)=True Then y#=1
If KeyDown(209)=True Then y#=-1
If KeyDown(30)=True Then x#=-1
If KeyDown(32)=True Then x#=1
If KeyDown(17)=True Then z#=1
If KeyDown(31)=True Then z#=-1

MoveEntity camera, x, y, z

;rotating
MoveMouse 400,300
Delay 10
RotateEntity camera, MouseY(), MouseX(), rz
If MouseX() >780 Then MoveMouse MouseX()-1, MouseY()
If MouseX() <20 Then MoveMouse MouseX()+1, MouseY()
If MouseY() >580 Then MoveMouse MouseX(), MouseY()-1
If MouseY() <20 Then MoveMouse MouseX(), MouseY()+1

UpdateWorld
RenderWorld
Flip

x=0
y=0
z=0
Wend
End
Cervantes




PostPosted: Wed Mar 10, 2004 9:11 am   Post subject: (No subject)

alright, AGAIN, i haven't run your prog. I'm at school atm. I'm not sure how well the thing you did works, but you can use mousemove easier by just saying this:

code:

mousemove graphicswidth / 2, graphicsheight / 2


I think that's how the pro games work, like shorthairs Smile
Sponsor
Sponsor
Sponsor
sponsor
jonos




PostPosted: Wed Mar 10, 2004 12:00 pm   Post subject: (No subject)

yeah, i didn't know the width and height names, i was trying just width and height but they didn't work, thanks for the names. im glad you are interested in helping me, this is driving me crazy, maybe blitz has something that will do it for me.
Cervantes




PostPosted: Wed Mar 10, 2004 4:31 pm   Post subject: (No subject)

yeah not knowing graphicswidth() and graphicsheight() are what you get for rushing into 3D so fast.
I'm reading through the 3D tutorials now, so I'll be a guru soon Smile
jonos




PostPosted: Wed Mar 10, 2004 5:52 pm   Post subject: (No subject)

bah, i dson't have time to learn it properly, ill learn it eventually if i need it, i can always search through help or ask someone on a message board.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Other Basics
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: