Help with camera's???

Blitz3D Forums/Blitz3D Beginners Area/Help with camera's???

W(Posted 2005) [#1]
I know you probably hear this form the newer 3-d programmers, but how exactly does one go about switching camera's.Like for instance if I wanted to allow my user to zoom in,like with a gun I have put on screen, what would I need to do to accomplish this??


Ross C(Posted 2005) [#2]
Try looking at the CameraZoom command.


WolRon(Posted 2005) [#3]
Also, you CAN have multiple cameras.
NormCam = CreateCamera()
ZoomCam = CreateCamera()
CameraZoom(ZoomCam, 10)
HideEntity ZoomCam



W(Posted 2005) [#4]
Thanks WolRon, by the way do you happen to know what file types Blitz 3-D can use regarding animation sequences???


Topknot(Posted 2005) [#5]
LoadAnimMesh ( file$[,parent] )

Parameters:

file$ - mesh filename
parent - parent entity of mesh

Description:

Loads a mesh from a .x or .3ds file and returns a mesh handle.
Any hierarchy and animation information in the file is retained (if present in the file!).

For Camera's, here's my three camera options:

I just call "UpdateCamera()" in my Main Loop


Topknot ;)


W(Posted 2005) [#6]
Hey thanks guys the zoom function in my program is running smoothly now. but real quick can anyone tell me how to achieve more smooth mouse movement in my program, i have an aimer centered onscreen and when you try to actually use it, it is jumpy. Any suggestions???

;here's some of my code...
Global user.player = New player
user\x = 0
user\y = 0
user\z = -1.25
user\model = CreatePivot()
user\cam = CreateCamera(user\model)

;my camera(characters view)
PositionEntity user\cam,user\x,user\y + 1 ,user\z
PositionEntity user\model,0,-7.2,0
EntityRadius user\model,.99
CameraRange user\cam,.05,1000

;the aimer
Global aimer = LoadImage("crosshairs.bmp")
ScaleImage aimer,.65,.65
Global GW = GraphicsWidth()/2
Global GH = GraphicsHeight()/2

;--------------------------------------------------------
Function CheckMouse()
;apply the limitations on the mouse speeds
MouseSpeedx = MouseXSpeed()*0.25
MouseSpeedy = MouseYSpeed()*0.25

;allow mouse to turn the player up and down
TurnEntity user\model,0,-MouseSpeedx,0
TurnEntity user\cam,MouseSpeedy,0,0

;return mouse to center of screen
MoveMouse GW,GH

;don't allow the player to look up or down too far
If EntityPitch(user\cam) >= 75
RotateEntity user\cam,75,EntityYaw(user\cam),0
EndIf

If EntityPitch(user\cam) <= -50
RotateEntity user\cam,-50,EntityYaw(user\cam),0
EndIf
End Function
;--------------------------------------------------------

Any Help will be appreciated thanks again guys


Stevie G(Posted 2005) [#7]
Make your MouseSpeedx / y variables floats .. should work much better.

Stevie


W(Posted 2005) [#8]
So how exactly do I go about making my MouseSpeedx\y variables floating points??

-Oh and one more question off topic here but how would I make my FPS run faster. It seems to slow down because of my textures, is there any way of speeding it up??


big10p(Posted 2005) [#9]
So how exactly do I go about making my MouseSpeedx\y variables floating points??


MouseSpeedx# = MouseXSpeed()*0.25
MouseSpeedy# = MouseYSpeed()*0.25



W(Posted 2005) [#10]
Oh yeah uhhh I knew that..... :)
thanks big10p

-May I pick your brain on how to improve the performance speed of my First Person Shooter??


Stevie G(Posted 2005) [#11]

Oh and one more question off topic here but how would I make my FPS run faster. It seems to slow down because of my textures, is there any way of speeding it up??




There are quite a few optimisations you can apply but it may help by answering a few questions first ...

How many surfaces / textures are you using? Surface / Texture count is a framerate killer.

How big are the textures you are using? Can you reduce these ... generally huge textures will give me a massive speed hit.

How many polys are in the level and the entities in the game? You may have the reduce the poly count on your objects/level or split the level into cullable sections.

What other things are doing on in the game? It may be that we could help optimise some of your functions.

Stevie


jfk EO-11110(Posted 2005) [#12]
Also make sure not to use too much LinePicks (including CameraPicks and EntityVisible), not too many Alpha Objects that are obscuring one another (well partialy since they're alpha - a high number of alpha levels may almost freeze th framerate). Don't use Collision when it can be done faster (eg. using EntityDistance). Not too many anitmated Meshes. Of course, don't lose control over the polycount. A Map shouldn't contain more than 50 Thousand tris IMHO, I'd rather keep it below 25k, for the weak machines. Don't waste Triangles or surfaces/Textures in your map design! LowPOly Modeling is a science by its own, get into it. If your map is huge, think about to implement some kind of VIS Occlusion, so only the visible parts are rendered.

I think there are some optimation tips in the tutorial section.


W(Posted 2005) [#13]
Thanks guys I think it is the textures. Because my program slows down when I approach a building in my level, but if I enable polygon mode the program speeds back up. So I am guessing it's the textures. I am now looking into fixing them.
I have found though if I shrink my textures, as you suggested, that they no longer look very realistic and become too obvious in my game. Is there any way to fix this??


jfk EO-11110(Posted 2005) [#14]
add "Print TrisRendered()" after your Renderworld and tell us what it says.


slenkar(Posted 2007) [#15]
how long does it take to print trisrendered man?


caff_(Posted 2007) [#16]
Holy thread resurrection batman!

Instead of print, try:

Color 255, 255, 255
Text 0, 0, TrisRendered()

This should be between Renderworld() and Flip