Archive

Posts Tagged ‘tutorial’

Set start_point for Panda3D useing Blender

August 30th, 2009

How to create a start point position for your maps/models useing blender and Panda3D. When I was following the Roaming Ralph sample code I was unable to recreate the world model to use the start point value. This is how to do it.

Step One:
Create a Vertex or plane, any thing, in the place where you want your start_point to be.

Step Two:
Make sure that you are in Object Mode not edit. Press F7 which will take youto the Object Panel (See Left) and change the name of the object to “start_point” (See Right)

Step2Step3

Step Three:
Export useing chiken to egg, and check to see if it worked by pressing “Shift + L”, check the command line to see if it says something like,  PandaNode start_point T:m(pos -6.71705 9.45356 5.36108)

You should now be able to get the position of the start point by doing something like this. self.environ.find(“**/start_point”).getPos()

With help from here and here. Hope this helps someone. Comments welcome ^_^

Pete Programming, Tutorials , , , ,

HTML #2

March 7th, 2008

Some basic HTML Tags which are mainly used for text.

<b> </b>

That is the bold tags anything in side the two tags will be bold

e.g

<b>This is bold</a>

This is bold

<i> </i>

That is the italics tags anything inside the two tags will be in italics

e.g

<i>This is italics</i>

This is italics

<center> </center>

That is the center tags, it will center any text within them.

e.g

<center>This is in the center</center>

This is in the center

<font size=”XX” color=”XXXX”> </font>

That is the font tag it has three atributes size, color and face. Size and color are well the size and color. The face atribute is the font face e.g Verdana, Times New Roman etc. Normaly you can leave out the face atribute as the web brower will just use the defualt.

e.g

<font size=”3″ color=”red”>
This is some text!
</font>
<font size=”1″ color=”blue”>
This is some text!
</font>
<font face=”arial” color=”red”>
This is some text!
</font>

 

Size 3, colour red
Size 1, colour blue
Font face arial colour red

Note that colour is spelt the american way color.

Now lets look at some other tags.

<a href=”##”>##</a>

That is a basic hyperlink structure.

e.g

<a href=”http://www.nationpigeon.com”>Nation Pigeon</a>

Nation Pigeon

<img src=”###”>

That is the basic structure of an image tag.

e.g

<img src=”http://www.nationpigeon.com/wordpress/wp-content/themes/unsleepable_v16/images/title.gif” width=”225″ height=”80″>

That example uses the source atribute (src=”xx”), the width and height. The width and hight are not required but it will make the page load up nicer. The unbers that you enter are the width and height in pixes of the source image.

<marquee bgcolor=”##”
direction=”##” width=”##”></marquee>

That is the marquee tag (scrolling text). With that you can have the text scroll up/down/left/right, by useing the ‘direction’ atribute. You can also change the width. Aswell as the background colour.

e.g

<marquee bgcolor=”#efefef” direction=”right” width=”75%”>This is going right</marquee>
This is going right

But be warned useing this alot can get annoying. If you want any more just ask.  Sorry It dosent look that good.  I’ll get it sorted soon.

Pete Programming, Tutorials ,

How to install a PHP Web Server in Windows XP

March 5th, 2008

If you want to learn PHP you will need a server that has PHP support. If you don’t feel confident enoght too install a major web server and all the bits then good news. There is a software called Nanoweb, which is a free small web server that supports PHP. It works on both Linux and Windows. So for Windows download the Windows installer here

TIP: Download the version that has PHP with it if you do not already have that installed on your machine.

One you have it downlaoded double click on the installer and click on ‘Extract’

[Image nanoweb One]

It will extract the files and then terminate the install

[Image nanoweb two]

It will load up the read me file and once you click on close it will continue with the install and end. If you would like to read the read me at another time then you can find it at C:\nanowe.

Now that it is all installed goto your desktop and double click on ‘Start Nanoweb’ Unblock windows firewall and you should see a command prompt window saying the following.

[Image nanowebThree]

This means that the server is all working fine. To make sure of that type in localhost into your web browser (Internet Explorer, Firefox Netscape etc) You should see “Welcome to nanoweb!”. That file is located at C:\nanoweb\www, the www folder is the main root directory (folder) of the server. This is where you will be saving all of your PHP script files.

That’s it! All you need to do to set up a PHP development web server. If you want other people to view your files then you may have to port forward your ip address, this will be coverd at another time.

If you liked this and are a nice person would you like to donate to my Stargate fund?


Pete Tutorials ,

PHP #1

December 11th, 2007

To start with PHP you need to have a web server that supports PHP. You can either use a free web host, or run your own server. If you want to run your own web server on windows just download XAMPP. Once you have that downloaded and installed, all you do is save your PHP scripts in the htdocs folder (Same for all web servers) then navigate (in a web browser) to http://localhost/. Or if you are useing a free web host such as http://awardspace.com just upload the php scripts to the root directory (htdocs)

To write a PHP script you just open up a text editor (e.g Notepad, gedit etc) and write in the PHP script and save as filename.php make sure that it ends in dot ph.

Now to make sure that the server knows that it is a PHP script you musty have <?php at the beginning and ?> at the end.

So we will start with a basic Hello world! example. Write don’t copy this into your hello.php file:

<?php

echo "Hello World!";
?>

There you go a very simple PHP scrip.

Hope this helped, Pete Out

(Any Questions Just Ask)

If you liked this and are a nice person would you like to donate to my Stargate fund?


Pete Programming, Tutorials ,

HTML #1

December 9th, 2007

Okay lets start of with some simple HTML. Today we will earn how to use the heading tags (H1, H2, H3 etc) and the bold (B) tag. And we will also learn how to setup your (possible) first page.

Start with open up your best text editor, I will be using gedit, feel free to se an y other such as Notepad (Windows) or what ever Mac Uses, can someone tell me please, thanks.

Okay so now that we have our text editor open. Type into it: (Don’t Copy)

<html><head>

<title>First Page</title>

</head>

<body>

<h1>Heading in biggest size</h1>

<b>Text in bold</b> Text not in bold!

</body>

</html>

There are six tags in that script. Tags at the text in the more than and less than arrows ‘<’ and ‘>’. The first tag is the HTM tag, this normally has other bits to the right of it but we wont use them today. It is used to tell the web browser (e.g Opera, Internet Explorer, Firefox, Konquor) that it is a html page and that it should display it.

The next tag is the head tag, this is where you put all the information that you want to give to the web browser, things like what the sites title is (the thing that comes up in the top of the window) what the site is about keywords and all that, I’ll go through them later.

The next is the title tag, this sets whatever text is in between the two tags to the top of the web brows window, mess around with it and you will see.

The next tag is an end tag all end tags have a ‘/’ in it like this ‘</tag-name>’. The ‘</head>’ tag ends the head tag, this means that anything outside this tag will not be looked at by the web browser as nice iformation that it can use, it will just dispay it to the viewer.

Right this is a new tag ‘<body>’, that marks the start of the body of the page. Anything in this will be displayed by the web browser as what you see now.

Okay this tag <h1> is a formatting tag it will set th size of the text that it is around. You can use this in different ways, well what I mean is that there are many different ways that this tag can be used erm no thats not what i mean here i’ll how you.

<h1>Heading One</h1>

<h2>Heading Two</h2>

<h3>Heading Three</h3>

<h4>Heading Four</h4>

<h5>Heading Five</h5>
<h6>Heading Six</h6>

So as you can see the different numbers that you put in this tag change the size of the text.

The next tag is another formatting tag ‘<b>’ anything inbetween these tags will be in a bold font.

And the last two just end the body and the html tags. This isabout it for the first lesson in HTML. And incase you are wondering what it stands for it is Hyper Text Mark Up Language. And it is a scripting language.

Oh and here is how to do comments:

<!– Hello this is a comment, I will not show up on the browser, but i will show up in the source tafa –>

And here is how it should look in your web browser.

Heading in biggest size

Text in bold Text not in bold!

Hope this might have helped someone, any questions I will be happy to help.

Pete

If you liked this and are a nice person would you like to donate to my Stargate fund?

Pete Programming, Tutorials ,