Graal Forums

Graal Forums (http://forums.graalonline.com/forums/index.php)
-   NPC Scripting (http://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Graal's Image Zooming Problem (http://forums.graalonline.com/forums/showthread.php?t=86709)

wild8900 07-05-2009 03:42 AM

Graal's Image Zooming Problem
 
I am working on a psuedo 3d engine and its going really really good. You can "walk" around several objects and it scales and moves their image around based on your direction and location (The basics). Only problem is the way graal zooms its images. Its hard to explain but as it is now, graal seems like its trying to zoom it from the center of the image. How would I work around that and make it zoom from the bottom center? Ive tried alot of formulas to tweak its draw y location based on its zoom to make it look like its zooming from its bottom center. No luck at all.

Galdor 07-05-2009 04:13 AM

just nag on stefan to give you a 3d server xD

wild8900 07-05-2009 04:31 AM

LOL too much work. I'm making a mario kart type event :3

Galdor 07-05-2009 04:37 AM

Quote:

Originally Posted by wild8900 (Post 1504273)
LOL too much work. I'm making a mario kart type event :3

sounds awesome =D

fowlplay4 07-05-2009 04:40 AM

Is this the effect you're looking for..?

Graal Script Code:

//#CLIENTSIDE

function onCreated() {
  
with (findimg(200)) {
    
image "block.png";
    
player.x;
    
player.y;
    
this.origx x;
    
this.origy y;
  } 
  
setTimer(0.05);
}

function 
onTimeout() {
  
onAdjustZoom();
  
setTimer(0.05);
}

function 
onAdjustZoom() {
  
with (findimg(200)) {
    
zoom cos(thiso.angle) * 0.5;
    
this.origy - (getimgheight(image) / (layer >= 32)) * zoom;
  }
  
this.angle += pi 32;


I just used the cos to zoom the image in and out to test it.

wild8900 07-05-2009 04:47 AM

I've never even heard of stretchx and stretchy lmao. What are they?

wild8900 07-05-2009 05:01 AM

Yeah that's the effect I want to achieve but your example seems kind of hard to incorporate with the rest of my script. Ill keep testing.

fowlplay4 07-05-2009 05:04 AM

Quote:

Originally Posted by wild8900 (Post 1504279)
Yeah that's the effect I want to achieve but your example seems kind of hard to incorporate with the rest of my script. Ill keep testing.

Glad I could help, good luck.

Matt 07-05-2009 05:27 AM

Can't wait to play the finished product. ^^

wild8900 07-05-2009 01:30 PM

1 Attachment(s)
Fixed it! I made a work around. Instead of adjusting it for different height images, I made all images the same height! 128 pixels high. Perfect. I also made textured walls :3 Doesn't lag clientside at all. It also shows other players with their text and nickname.

Crow 07-05-2009 01:50 PM

Good job, looks awesome :)

Galdor 07-05-2009 02:52 PM

wow! thats awesome make an oldschool FPS like doom or wolfenstein 3d lol xD

wild8900 07-05-2009 03:40 PM

Ahaha. "WolfenGraal 3D".
Im kinda nervous to keep it uploaded to the server I'm making it on. Some of my fellow staff are really untrustworthy... (On npulse)

xXziroXx 07-05-2009 05:14 PM

Quote:

Originally Posted by wild8900 (Post 1504354)
Ahaha. "WolfenGraal 3D".
Im kinda nervous to keep it uploaded to the server I'm making it on. Some of my fellow staff are really untrustworthy... (On npulse)

If you don't find Testbed Server any better, I could provide you with an RC.

DustyPorViva 07-05-2009 07:35 PM

How the hell do you resize your polygons like that for the walls? When I do that, it divides the polygon into to triangles and distorts the texture -_-

Crono 07-05-2009 07:40 PM

That's cool and all but it's nearly 2010 and we now have early 90's 3D that was released a year after Zelda: A link to the Past? wat

Galdor 07-05-2009 07:43 PM

Quote:

Originally Posted by Crono (Post 1504390)
That's cool and all but it's nearly 2010 and we now have early 90's 3D that was released a year after Zelda: A link to the Past? wat

Progress! ^^

wild8900 07-06-2009 12:54 AM

Quote:

Originally Posted by DustyPorViva (Post 1504389)
How the hell do you resize your polygons like that for the walls? When I do that, it divides the polygon into to triangles and distorts the texture -_-

I hate to give away my secrets :P but Ill tell you that they aren't polygons. Its a really extremely simple solution. I tried using polygons and All I got were drab solid colored walls.

EDIT: How do I upload this to a server without having all the other staff take it and tear it apart? Or worse, have it end up on OTHER servers.

Galdor 07-06-2009 01:00 AM

...

wild8900 07-06-2009 01:02 AM

Quote:

Originally Posted by Galdor (Post 1504477)
hehe you just used several images behind each other? :D

Ssshhh! You got me! That's like revealing all the smoke an mirrors that magician uses. >:

Robin 07-06-2009 04:11 AM

1 Attachment(s)
Ah I thought you were doing a GTA2 style..

Attachment 48872

How does this not lag clientside? :S

wild8900 07-06-2009 04:45 AM

Very similar to GTA2 style actually. It doesn't lag at all surprisingly. But then I have a dual core proc and a fair amount of ram. That might be why. x3
Also, I only have it drawing the wall images within the screen and at a change-able distance.

Gambet 07-06-2009 04:08 PM

Quote:

Originally Posted by wild8900 (Post 1504527)
Very similar to GTA2 style actually. It doesn't lag at all surprisingly. But then I have a dual core proc and a fair amount of ram. That might be why. x3
Also, I only have it drawing the wall images within the screen and at a change-able distance.


I can't imagine this being very smooth online, nor visually appealing since, as Crono stated, it is very basic 90's 3D. There's a reason why Stefan went for a new engine when working on Graal 3D, but at least you managed to make a level appear 3D even though it would look rather strange from the Graal character's perspective.

Crow 07-06-2009 09:05 PM

Whether it's visually appealing or not depends on the viewer. I always liked that style/way of creating three-dimensional environments :D

wild8900 07-07-2009 01:48 AM

I actually like the retro early 3D look. It is surprisingly smooth online, believe it or not. It will only ever be appealing as wolfenstein 3D but who knows? Maybe with a some nice textures and graphics it'd look nice.

You would think this retro 3D would be appropriate, seeing as how we are still playing Zelda LttP online lol!

Crono 07-07-2009 01:57 AM

Quote:

Originally Posted by wild8900 (Post 1504772)
You would think this retro 3D would be appropriate, seeing as how we are still playing Zelda LttP online lol!

SNES gfx > early 3D imo.

haro41 03-21-2013 12:05 AM

necro post inc...
Quote:

Only problem is the way graal zooms its images. Its hard to explain but as it is now, graal seems like its trying to zoom it from the center of the image. How would I work around that and make it zoom from the bottom center?
Has there ever been a .zoomcenter added, or another method that does this? A workaround like changing the x,y coordinates to compensate would not be ideal.

DustyPorViva 03-21-2013 12:36 AM

Graal Script Code:

GuiShowImgCtrl.rotationcenter string the current rotation center (only works when useowncenter=true



All times are GMT +2. The time now is 01:01 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.