Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: New to TV  (Read 447 times)
fmienie
Community Member
*
Posts: 8


« on: June 19, 2008, 02:21:45 AM »

Hi,

I am new to TV and I just need to get a understanding of the capabilities of TV.
Is it posible to create a game like Unreal or Quake with TV.

If so, can I only use TV or will I need some other software to do the graphics for example.

Thanks for your response.
Francois
Logged
ZaPPZion
Community Member
*
Posts: 299


« Reply #1 on: June 19, 2008, 02:51:11 AM »

Yes, it's possible, but yea you do need other software as well. You need a program to make your models (3ds max for example), you need a program to make your textures (photoshop for example), you need to make maps somehow (maybe code your own map maker, since that helps you understanding the engine really good). So there really is a lot to it. It's not easy to make a game like Unreal or Quake. I don't want to discourage you, but it's going to be hard (but possible!). So it's best to first get to know the engine a little bit better before deciding what sort of game you are going to make, since it's harder then you think most of the time ("some stuff that seems hard is easy, stuff that seems simple is hard" is my basic rule:P)
Logged
fmienie
Community Member
*
Posts: 8


« Reply #2 on: June 26, 2008, 04:39:15 PM »

Thanks for your reply. I shall not start by trying to create a Unreal type of game. I need a engine to create 3D simulations.

Where do I start with TV. I am strugling to get tutorials that show you step by step what to do to get to the stage where I can see something on the screen, let's say a 3DWall.

Do I need to declare some objects first. I know I have to declare a new instance of TVEngine, but then what.
Do I need a Scene instance before I can add a wall.
Do I need to set a camera before I can see the wall.

I don't even know the very basics. I am new to game programing. I develope windows and web applications using VB.Net.

Please help me to get started with a room in TV3D, where I then can try and create mesh objects in Blender like a table and then add it to my TV3D room.

Thanks
Francois

Logged
Raine
Customers
Community Member
*****
Posts: 1086


« Reply #3 on: June 26, 2008, 05:02:35 PM »

Well, the 6.2 tutorials should really help you, the library hasn't changed that much from 6.2 from 6.5 (but yes, there are some changes to be aware of); you'll find the basics covered at least.

Welcome aboard.
Logged

ZaPPZion
Community Member
*
Posts: 299


« Reply #4 on: June 27, 2008, 01:26:14 AM »

About the object declaration:

Code:
private TV as TVEngine
private Scene as TVScene

TV = new TVEngine()
Scene = new TVScene()

This is not all, you'll need to initialize some standard stuff as well. I'll post a code sample of what my defaults are.
Code:
TV.Init3DWindowed(form.hWnd, true)
TV.DisplayFPS(true)
TV.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE)
TV.SetDebugFile(Application.StartupPath + "\\debug.txt")
TV.SetDebugMode(true,true,false,false)
Scene.SetViewFrustum(45, 10000)
Scene.GetCamera().SetCamera(10, 10, 0, 10, 10-0.1f, 10)

that's the absolute minimum you'll need to load some objects from blender, or to create walls and such, you'll need a TVMesh object.

Code:
private Mesh as TVMesh
Mesh=Scene.CreateMeshBuilder("name of the mesh")
Mesh.AddWall(0, x, y, x2, y2)
Mesh.LoadX(filename, true, true)

to give a wall a texture, you'll need to open texture first. That means you'll need a texture factory object. To access a texture from the texture factory, you've got 2 options. The TVTextureFactory class returns an integer when you load a texture. You can store that, and use that as the texture for the wall, or you could give the texture a name (see code sample) and use the TVGlobals class to get the integer pointer to the texture.

Code:
private TF as TVTextureFactory
private Globals as TVGlobals

TF.LoadTexture(filename, "nameoftexture")
wall.AddWall(Globals.GetTex("nameoftexture"),x1,y1,x2,y2);

after you've done all of this, you'll need to make sure stuff is rendered to your screen. It's quite easy to do so. You can make a function or sub or whatever it is named in VB.NET (never actually programmed in VB.NET). Name it whatever you want, and put the VB.NET similar of this in there:

Code:
while(true)
{
  TV.Clear();
  Scene.RenderAll(true);
  TV.RenderToScreen();
  Application.DoEvents();
}

Now this won't make your program handy to quit, but i'm sure you can find out how to do that from the examples of this 6.3 SDK.

Good luck, and welcome aboard!

Greetings,
ZaPP
« Last Edit: June 27, 2008, 08:07:52 AM by ZaPPZion » Logged
fmienie
Community Member
*
Posts: 8


« Reply #5 on: June 27, 2008, 03:14:10 PM »

Thanks a lot for the create response.
Logged
fmienie
Community Member
*
Posts: 8


« Reply #6 on: June 30, 2008, 05:28:06 AM »

Hi guys, I get an error when I close my game.
I have a Exit button and when I click it the following error pop up

"Object reference not set to an instance of an object."

the code for my Exit button:
"Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        DOLOOP = False

        TF.DeleteAllTextures()
        SCENE.DestroyMesh(MESH)
        TV.ReleaseAll()

        Me.Close()
End Sub"

The code for my game, it works and renders the wall, but it does not exit properly:
"Public Class Form1

    Private TV As New TVEngine
    Private SCENE As New TVScene
    Private TF As New TVTextureFactory
    Private G As New TVGlobals
    Private MESH As New TVMesh
    Private DOLOOP As Boolean = False
    'Private inpEng As New TVInputEngine

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TV.Init3DWindowed(Me.Handle, True)
        TV.DisplayFPS(True)
        TV.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE)
        TV.SetDebugFile("c:\debug.txt")
        TV.SetDebugMode(True, True, False, False)
        Scene.SetViewFrustum(45, 10000)
        SCENE.GetCamera().SetCamera(10, 10, 0, 10, 10 - 0, 10)

        TF.LoadTexture(Application.StartupPath & "\Wall.jpg", "LeftWall")

        Mesh = Scene.CreateMeshBuilder("LeftWall")
        MESH.AddWall3D(G.GetTex("LeftWall"), -20, 150, 30, 100, 30, 5, False, True, -20)

        Me.Show()
        Me.Focus()

        DoTheLoop()
    End Sub

    Public Sub DoTheLoop()
        DOLOOP = True
        Do
            TV.Clear()
            SCENE.RenderAll(True)
            'checkinput()
            TV.RenderToScreen()
            Application.DoEvents()
        Loop While DOLOOP = True
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        DOLOOP = False

        TF.DeleteAllTextures()
        SCENE.DestroyMesh(MESH)
        TV.ReleaseAll()

        Me.Close()
    End Sub"

Thanks a lot
Francois
Logged
ZaPPZion
Community Member
*
Posts: 299


« Reply #7 on: June 30, 2008, 06:46:43 AM »

On what line does it crash?
Logged
fmienie
Community Member
*
Posts: 8


« Reply #8 on: June 30, 2008, 06:52:17 AM »

If I go through the code line by line. It executes it all and when it closes the form,it is not even visible anymore, then it gives me the error.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks