Main Menu

Some 3D screen shots

Started by Kman1011, March 22, 2009, 09:46:28 AM

Previous topic - Next topic

Kman1011

Here are some of the screen shots from a program I am working on

I used RotateVertexListtoCamera to calc all the vertexes



mind U these are just preliminary shots using Quad polygons

In the end hopefully it will look similar to the third shot from a program I wrote a while back.


I will be back with more updates and screenshots. I don't have as much time on my hands these days..
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

Makeii Runoru

I like it. : )
I'd like to see more, and possibly an editor?
This signature is boring, and could be improved. However, the user of this signature doesn't need a fancy signature because he or she doesn't really care for one.

Kman1011

#2
What type editor? Map editor?

Here is a basic construct I started with to show an 3D array of cubes (with near plane grid points in white(1))

You can see the cubes at any angle using the mouse and move ahead with the up arrow key.




PlayBASIC Code: [Select]
; PROJECT : 3dCam
; AUTHOR : Kevin Picone
; CREATED : 1/17/2006
; EDITED : 21/02/2009
; MODIFIED: Kent Seburn
; ---------------------------------------------------------------------

#Include "VertexObjects"

;OpenScreen 1024,768,32,2

sw=GetScreenWidth()
sh=GetScreenHeight()

ProjectionX#=400
ProjectionY#=400

; Init the Size of the Source and rotated Vertexs
Constant SrcVertSize =12
Constant DestVertSize =20

Global Xpos#
Global Ypos#
Global Zpos#
Global Map_X
Global Map_Y
Global Map_Z

Type tObject
status
; Object Bank
ObjectBank
; Vertex Bank
VertexBank
; Rotation Speeds for this object
RotSpeedX#
RotSpeedY#
RotSpeedZ#
NumberOFVerts
EndType


Dim Object(10) As tObject



NumberOfVertex=10000


Obj=1


; ==================================
; make the corner pillars
; ==================================
x=900
z=900
y=900
sizex=1800
Sizey=1800
sizez=1800

NewObject(0,x,y,z,SizeX,SizeY,SizeZ,100,100,100,7000)

NewObject(1,2000,2000,2000,100,100,0,25,25,25,25) ;wall

NewObject(2,2000,2000,2000,100,0,100,25,25,25,25) ;floor
NewObject(3,2000,2000,2000,0,100,100,25,25,25,25) ;Wall
NewObject(4,2000,2100,2000,100,0,100,25,25,25,25) ;Cieling
NewObject(5,2000,2000,2100,100,100,0,25,25,25,25) ;Wall

NewObject(6,2100,2000,2000,0,100,100,25,25,25,25) ;Wall

; Create Camera Object
; =====================================
CameraObject=CreateVertexObject(2000,2000,2000)
VertexObjectProjectionMode(CameraObject,1,ProjectionX#,ProjectionY#)



obj=6


; =====================================
; Create Desitnation Vertex Buffer
; =====================================
DestVertexBank=NewBank(20000*DestVertSize)



; =======================================================
; Pre-calc the shading
; =======================================================

Dim ShadeBufferBuffer(20000)
NumberOfVertexdepth#=1000
scaler#=100/NumberOfVertexdepth#
col=RGB(255,255,255)
For lp=0 To NumberOfVertexdepth#
ShadeBufferBuffer(lp)=RGBFade(col,(NumberOfVertexdepth#-lp)*scaler#)
Next

CreateCamera 1


StartTime=Timer()+5000

Do
Wait 50
CaptureToScene
ClsScene

; Rotate vertex list (with XYZ rotation order)
CameraAddress=GetBankPtr(CameraObject)

DestVertexbufferAddress =GetBankPtr(DestVertexBank)


TotalNumberOFVertexs=0

For Obj=0 To GetArrayElements(Object().tObject,1)
If Object(obj).status=True
If obj>0
col=$ffffff
Else
col=$ff0000
EndIf
ThisObject=Object(obj).ObjectBank

ObjectAddress=GetBankPtr(ThisObject)
SrcVertexBufferAddress=GetBankPtr(Object(obj).vertexbank)

NumberOfVertex=object(obj).NumberOFVerts

RotateVertexListToCamera CameraAddress,ObjectAddress,SrcVertexBufferAddress,SrcVertSize,DestVertexbufferAddress,DestVertSize,NumberOfVertex

Address =DestVertexbufferAddress+8
Do
z#=PeekFloat(Address)
If z#>10
CaptureDepth z#
DotC 400+PeekFloat(Address+4),300+PeekFloat(Address+8),col;ShadeBufferBuffer(z#)
EndIf
address=address+destVertSize
DecLoop NumberOfVertex
EndIf
Next

DrawCamera 1
Login required to view complete source code



(1)- Near planes broken down 4 x 4 to fix problem with near Z plane clipping because no points can move behind a Z distance of zero
Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

Makeii Runoru

Yeah I had that problem when working in some 3D as well with Z clipping. I still find 3D to be a lot of work, so I'll just try to master 2D design first.

And by an editor, I meant a map editor, yea. Perhaps something similar to "Build," the editor for Duke Nukem 3D levels : )
This signature is boring, and could be improved. However, the user of this signature doesn't need a fancy signature because he or she doesn't really care for one.

kevin

Kman,

     It's good to see somebody tackling something outside the norm here.   If you can get it running up to speed in just standard PB,  then it'd fly in PBFX.