• Welcome to Dark Bit Factory & Gravity.
 

Visual Basic

Started by Clanky, March 01, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Clanky

Man, we have to start VB... boring! Did that in year 10, so I kinda know what I'm doing... and she's telling us like, all the rules.. ahh man! I guess it's her job! lol! So, our assignment is to make a VB app which draws something when you click the "DRAW" button you put onto the form... omg... haha! I'm gonna make my Form Title as "Clancy's Assignment" haha, hopefully she's like - Omg... he knows his stuff, extra marks!!!
Still don't know what I'm gonna draw though!

I'm just sitting here in the library (shutting like, now haha!) playing in the arcade (sooo coollll!!! DBF Arcade Rocks  :clap:) and chatting haha! yay, this is the life lol...

I might post the final app if any one wants to see it maybe haha... but, I dunno... Happy Arcading Shockwave, rain_storm and CoDeMaN haha... hopefully no one gets my titles off me again :( haha

Cheers  :cheers:
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Shockwave

Port a 3D starfield into it, or maybe load a picture of the Hoff or something mad like that. I think that Codeman uses VB. Maybe he'd help you out if you got stuck. Make something that will make her sit up and take notice... Or scare her :)

As for the arcade, I may be jumping the gun here but I intend to own it this month. I was cruelly robbed last month by Rainstorm and Codeman, each trophie I lost was like a physical blow.

In fact, Mel (my better half and chief lurker on this forum) was so happy with herself that she had beaten my Mahjong score that I had to offer 20 Karma to get her knocked off the top of the high score table. You could call it a professional hit and you'd be right :)

Oh and yes, please do post your app when it's done!
Shockwave ^ Codigos
Challenge Trophies Won:

MrP

Its definately got to be a picture of the hoff.... Good call shocky.... good luck with your app, and you should post it....

ferris

Another coder in school :)

I decided not to take VB, thought it would be a waste of time.

Bit I did take web design, and trust me, it's worth it when you prove to the teacher you're better than he/she is :D

Go all-out, make her cry  :diablo:
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

slinks

Quote from: MrP on March 01, 2007
Its definately got to be a picture of the hoff.... Good call shocky.... good luck with your app, and you should post it....

And Bono, don't forget Bono! Make her weep!
I love semi-colons way too much ^^;
Challenge Trophies Won:

Inc0gnit0

Quote from: Shockwave on March 01, 2007

As for the arcade, I may be jumping the gun here but I intend to own it this month. I was cruelly robbed last month by Rainstorm and Codeman, each trophie I lost was like a physical blow.


Oh how I wish I could give out masses of karma to bribe Rainstorm and Codeman to stop winning trophies.  Nick is so unbearable to live with when he sees he lost a trophy..he makes Victor Meldrew seem like a saint  :D

Quote from: Shockwave on March 01, 2007

In fact, Mel (my better half and chief lurker on this forum) was so happy with herself that she had beaten my Mahjong score that I had to offer 20 Karma to get her knocked off the top of the high score table. You could call it a professional hit and you'd be right :)


Nice to see you realise who the better half is  ;) Chief Lurker aay....well at least I'm top of something then  ;D

Love the Hoff and Bono idea!


Shockwave

Mel, you are just jealous. The only games you can play are the ones you use the mouse for because your bump puts the keyboard out of range... It's no wonder it took you about 20 mins to write that message... :P

Better half? I understand politics love.

Btw, sorry Clanky I won some of your trophies by mistake.
Shockwave ^ Codigos
Challenge Trophies Won:

Clanky

#7
haha! I was actually thinking last night about a scrolling starfield... mayby just the same as the one on my Yah Spaced Invaders (can that be done?)... and maybe a scrolling text (again, if it's possible?)... like a yabasic demo haha! I also thought about a rotating vector cube - but I've never done 3D in yabasic, let alone any other language haha.
All this appears after you click the DRAW button haha. yay

"Hoff and Bono?" ummmmmmmmm  ??? [shame]

ps... thanks for taking my trophies :( aww man... another 4 hours tries to get them beack haha!

---------------------

Ok, my project doesn't seem to work because I'm not to sure how to dim the values... and I've forgotten the work we did on wednesday - so I can't make the pen colour and stuff....

man its wierd! yabasic lets you state values as

star=100
dim star_x(star), star_y(star)

and then it's alright...

VB you have to say

Dim star As blah blah blah blah!

so I don't know how to do the scrolling star field... DAmN!!!  >:(
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Inc0gnit0

1st - Shockwave - 21 wins
2nd - Rain_Storm - 5 wins
3rd - Clanky - 5 wins

Oh no.....I can't stand the chanting. I'm off to buy some ear plugs!!! I can't bare to hear "I'm King of the arcade, I'm King of the arcade" anymore   :stirrer:

All the best with your assignment Clanky.

CoDeMaN

Quote from: Inc0gnit0 on March 02, 2007
1st - Shockwave - 21 wins
2nd - Rain_Storm - 5 wins
3rd - Clanky - 5 wins

Oh no.....I can't stand the chanting. I'm off to buy some ear plugs!!! I can't bare to hear "I'm King of the arcade, I'm King of the arcade" anymore   :stirrer:

All the best with your assignment Clanky.

Early days yet .... He can win for now ..... But just keep an eye on his trophie's  ;)
they will soon be dropping  :2funny:

Shockwave

Gonna make you eat those words Codeman!  :goodpost:
Shockwave ^ Codigos
Challenge Trophies Won:

Hotshot

I used to learn VB for 3 yrs and it is good language.
3D starfields for VB 6 is pretty easy to do without having anythings to worry about WINDOW!

Clyde

How did we get on the subject from VB to talk of the arcade.

Back On Track: Am I right in presuming that Visual Basic is the successor to Quick Basic \ QBasic?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

ferris

Visual Basic uses an editor like visual C++, but the programs are set up based on objects, not just code.

I like to think of it as Flash Actionscript for Windows :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Clanky

How would I be able to start a 3D starfield without importing it, becaue the idea of this assignment is to make graphics using the in-library commands, eg. DrawRectangle, DrawLine, FillRectangle, FillEllipse... etc. If I was to be able to do one like in yabasic, I could just use FillRectangle yea? And scroll it like yabasic?
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

rain_storm

Clanky in Yabasic you have to do the hard math I dont know about VB but I do know that many languages allow you to use library calls (ex. 'rotate entity ...' in Blitz 3d) if VB allows for this too you could save yourself alot of hassle but making the appropriate call and if not then you will have to resort to the maths.

'Early days yet .... He can win for now ..... But just keep an eye on his trophie's 
they will soon be dropping  ' - Couldn't agree with you more CoDeMaN

'Gonna make you eat those words Codeman! ' Shocky you should be more careful of making bold statements lets not have another arcade war what with work bein so busy my beauty sleep will surely suffer though my winninfg streak will not lol

Challenge Trophies Won:

Clanky

Umm yea, not too sure. My friend is pretty good at VB, so I'll pass it through with him next class... and hopefully he can help me with at least a scrolling star field... starfields in yabasic are pretty easy to run througth - I kinda like the way you have to make the field in yabasic, makes it fell more technical! lol.

I not too sure about a vector cube, I wouldn't be able to make it solid (as in yabasic with fill triangle) because you cant call triangles in VB! man!
So, it will have to be a rotating skeleton vector cube! lol... hopefully that can be made - and not imported!
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

rain_storm

#17
I absolutely hate it when a compiler says 'Triangle ? What are you on about? Theres no such thing as a triangle'
what the fuck?

heres a good start for you (you will have to port this to VB though)
set up 3 angles with values (ranging between 0 and pi*2 if VB expects angles in radians) or (between 0 and 360 if VB expects degrees) now get the values of cosine and sine of those angles and put them in variables like this
cx = cos(rotatex)
sx = sin(rotatex)
cy = cos(rotatey)
sy = sin(rotatey)
cz = cos(rotatez)
sz = sin(rotatez)
now for each pixel in a loop do this (If you need to rotate the scene) -

  rem rotate z axis
  newx = cz*x(p) + sz*y(p) ; rem rotating Z axis effects both X and Y but not Z values
  newy = cz*y(p) - sz*x(p) ; rem above was for X axis this is Y axis

  rem rotate y axis
  newz = cy*z(p) + sy*newx ; rem note that we are using the rotated value of x when we rotate the Y axius
  rotated_x = cy*newx - sy*z(p) ; rem this is the fully rotated value for the X axis

  rem rotate x axis
  rotated_y = cx*newy + sx*newz ; rem finished with Y axis now
  rotated_z = cx*newz - sx*newy ; rem and the Z axis is done too

or this (If you only need to move the scene)

  rotated_x = x(p) + dirx
  rotated_y = y(p) + diry
  rotated_z = z(p) + dirz

they are now rotated but you will have to apply perspective to make it look right it is best to multiply both X and Y by a value (scaler) and divide by the value of Z but you will also have to add a value to Z to move it some distance in front of the the point it is beeing viewed from. it might look something like this.

  x = rotated_x*scaler / (rotated_z + 100)
  y = rotated_y*scaler / (rotated_z + 100)

this is an extension to the familiar Yabasic demo that came with the demo disk (3D bouncing ball & 3D cube) but it is actually basic trigonametry which should exist within VB code without any hassle.

Challenge Trophies Won:

Clanky

Thanks, I'll see what I can come up with... I just hope that I can get it so that VB doesn't say "Not Verified" or something like it did when I tried to say - stars = 100
Then.. I had to DIM it, and even then, it said "something Expected

Thanks for you help with the cube rain :updance:

btw, hows the pool collisions comming?
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

rdc

A 3D starfield in VB would be about the same as in any language. Since this is an assignment, I won't code an example, but here are some things you need to check out:

1) You can use a timer to control the interval of updates.
2) You can draw right on the form using either Form1.Pset or Form1.Circle. You clear he form with Form1.Cls.
3) You'll need to redraw the screen with the OnPaint event so the screen will show when covered or minimized.

You don't need to use any triangles for a 3D starfield. I think the circle method works best, by scaling the size of the circle based on the Z distance.