1 model rendered 2 times?

Blitz3D Forums/Blitz3D Programming/1 model rendered 2 times?

asdfasdf(Posted 2005) [#1]
Is there a way to have only one model open and then render it twice in two different spots? render and then flipMESH render


Sledge(Posted 2005) [#2]
FlipMESH render? Dunno about that; try this:

Graphics3D 640,480,0,2
SetBuffer BackBuffer()

cam=CreateCamera()
CameraClsMode cam,0,1
box=CreateCube()
base=90

While Not KeyDown(1)

base=base+1 : If base>360 Then base=base-360
x#=0+Cos(base)

PositionEntity box,x,0,5
RenderWorld
PositionEntity box,x,4,5
RenderWorld
Flip
Cls

Wend



asdfasdf(Posted 2005) [#3]
I meant FlipMesh, render.
Thanks for the code


Ross C(Posted 2005) [#4]
Remember and set the cameraclsmode back to default after the last render, to clear the screen. Then set it afterwards back to

CameraClsMode cam,0,1


So it becomes:

Graphics3D 640,480,0,2
SetBuffer BackBuffer()

cam=CreateCamera()
box=CreateCube()
base=90

While Not KeyDown(1)

base=base+1 : If base>360 Then base=base-360
x#=0+Cos(base)

PositionEntity box,x,0,5
CameraClsMode cam,1,1
RenderWorld

PositionEntity box,x,4,5
CameraClsMode cam,0,1
RenderWorld

Flip
Cls

Wend



Rook Zimbabwe(Posted 2005) [#5]
Isn't Blitz Programmer a moderator that works for Blitz??? Should he not know this???

You create two cameras and you can viewport them or render them both (rear view mirror effect) but it does tend to make your code slower if you have a lot of polys on screen...

RZ


Sledge(Posted 2005) [#6]

it does tend to make your code slower if you have a lot of polys on screen



How about if you reduce the viewport? Does that not get you any speed back? Hang on, why am I asking you instead of just trying it out? :D


Rook Zimbabwe(Posted 2005) [#7]
You know that is a good question... IMO (without trying it out) no.

I say why: ((keep in mind this is theoretical and I expect someone with Empirical Knowledge to pundit firmly)) You are still rendering the TRIs... The second set of tris might be smaller BUT they are still TRI.

RZ


Damien Sturdy(Posted 2005) [#8]

Isn't Blitz Programmer a moderator that works for Blitz??? Should he not know this???



Only if Puki is!


_PJ_(Posted 2005) [#9]
I don't think reducing the viewport affects the speed at all.

AFAIK the only way to do this, is to 'cheat' and copy the mesh or use 2 cameras.